You are here

function template_preprocess_featured_content_block in Featured Content 7.2

Same name and namespace in other branches
  1. 6.2 featured_content.module \template_preprocess_featured_content_block()
  2. 6 featured_content.module \template_preprocess_featured_content_block()
  3. 7 featured_content.module \template_preprocess_featured_content_block()

Process variables for featured_content-block.tpl.php.

To create a template file for a block, copy:

featured_content-block.tpl.php => featured-content-block--[type].tpl.php e.g. featured_content-block.tpl.php => featured-content-block--manual.tpl.php

or

featured_content-block.tpl.php => featured-content-block--[delta].tpl.php e.g. featured_content-block.tpl.php => featured-content-block--1.tpl.php

Note that there is an underscore in the original template file but not in the overridden template files.

See also

featured_content-block.tpl.php

File

./featured_content.module, line 113
Featured Content module for created related & featured content blocks.

Code

function template_preprocess_featured_content_block(&$variables) {
  $variables['block_classes_array'][] = 'featured-content-block-' . $variables['block_settings']['delta'];
  $variables['block_classes_array'][] = 'featured-content-block-' . $variables['block_settings']['type'];
  $variables['block_classes'] = check_plain(implode(' ', $variables['block_classes_array']));
  $variables['theme_hook_suggestions'][] = 'featured_content_block__' . $variables['block_settings']['type'];
  $variables['theme_hook_suggestions'][] = 'featured_content_block__' . $variables['block_settings']['delta'];
}