function theme_block in Drupal 4
Same name and namespace in other branches
- 5 includes/theme.inc \theme_block()
Return a themed block.
You can style your blocks by defining .block (all blocks), .block-<i>module</i> (all blocks of module <i>module</i>), and \#block-<i>module</i>-<i>delta</i> (specific block of module <i>module</i> with delta <i>delta</i>) in your theme's CSS.
Parameters
$block: An object populated with fields from the "blocks" database table ($block->module, $block->delta ...) and fields returned by <i>module</i>_block('view') ($block->subject, $block->content, ...).
Return value
A string containing the block output.
Related topics
1 theme call to theme_block()
- theme_blocks in includes/
theme.inc - Return a set of blocks available for the current user.
File
- includes/
theme.inc, line 810 - The theme system, which controls the output of Drupal.
Code
function theme_block($block) {
$output = "<div class=\"block block-{$block->module}\" id=\"block-{$block->module}-{$block->delta}\">\n";
$output .= " <h2 class=\"title\">{$block->subject}</h2>\n";
$output .= " <div class=\"content\">{$block->content}</div>\n";
$output .= "</div>\n";
return $output;
}