theme_node($node, $teaser = FALSE, $page = FALSE)
drupal/includes/theme.inc, line 512
Return a themed node.
$node An object providing all relevant information for displaying a node:
$page Whether to display the node as a standalone page. If TRUE, do not display the title because it will be provided by the menu system.
A string containing the node output.
| Name | Description |
|---|---|
| Themeable functions | Functions that display HTML, and which can be customized by themes. |
function theme_node($node, $teaser = FALSE, $page = FALSE) {
if (module_exist('taxonomy')) {
$terms = taxonomy_link('taxonomy terms', $node);
}
if ($page == 0) {
$output = '<h2 class="title">'. check_plain($node->title) .'</h2> by '. format_name($node);
}
else {
$output = 'by '. format_name($node);
}
if (count($terms)) {
$output .= ' <small>('. theme('links', $terms) .')</small><br />';
}
if ($teaser && $node->teaser) {
$output .= $node->teaser;
}
else {
$output .= $node->body;
}
if ($node->links) {
$output .= '<div class="links">'. theme('links', $node->links) .'</div>';
}
return $output;
}