function theme_blockreference_formatter_default in Block reference 7
Same name and namespace in other branches
- 6 blockreference.module \theme_blockreference_formatter_default()
- 7.2 blockreference.module \theme_blockreference_formatter_default()
Theme function for 'default' blockreference field formatter.
File
- ./
blockreference.module, line 775 - Defines a field type for referencing a block from a node.
Code
function theme_blockreference_formatter_default($variables) {
$element =& $variables['element'];
$output = '';
$block = blockreference_formatter_get_block($element);
if ($block) {
$bid = $block->module . '_' . $block->delta;
if ($block_content = _block_render_blocks(array(
$block,
))) {
$build = _block_get_renderable_array($block_content);
$build[$bid]['#blockreference_element'] = $element;
$output = drupal_render($build);
}
}
return $output;
}