| Versions | |
|---|---|
| 4.7 – 5 | book_node_visitor_html_pre($node, $depth, $nid) |
Generates printer-friendly HTML for a node. This function is a 'pre-node' visitor function for book_recurse().
$node
$depth
is used only for generating output.
$nid
is used only for generating output.
modules/
<?php
function book_node_visitor_html_pre($node, $depth, $nid) {
// Output the content:
if (node_hook($node, 'content')) {
$node = node_invoke($node, 'content');
}
// Allow modules to change $node->body before viewing.
node_invoke_nodeapi($node, 'print', $node->body, false);
$output .= "<div id=\"node-" . $node->nid . "\" class=\"section-$depth\">\n";
$output .= "<h1 class=\"book-heading\">" . check_plain($node->title) . "</h1>\n";
if ($node->body) {
$output .= $node->body;
}
return $output;
}
?>