Same name and namespace in other branches
- 4.7.x modules/node.module \theme_node_preview()
- 5.x modules/node/node.module \theme_node_preview()
- 6.x modules/node/node.pages.inc \theme_node_preview()
- 7.x modules/node/node.pages.inc \theme_node_preview()
Display a node preview for display during node creation and editing.
Parameters
$node: The node object which is being previewed.
1 theme call to theme_node_preview()
- node_preview in modules/
node.module - Generate a node preview, including a form for further edits.
File
- modules/
node.module, line 1540 - The core that allows content to be submitted to the site.
Code
function theme_node_preview($node) {
$output = '<div class="preview">';
if ($node->teaser && $node->teaser != $node->body) {
$output .= '<h3>' . t('Preview trimmed version') . '</h3>';
$output .= node_view(clone $node, 1, FALSE, 0);
$output .= '<p><em>' . t('The trimmed version of your post shows what your post looks like when promoted to the main page or when exported for syndication. You can insert the delimiter "<!--break-->" (without the quotes) to fine-tune where your post gets split.') . '</em></p>';
$output .= '<h3>' . t('Preview full version') . '</h3>';
$output .= node_view($node, 0, FALSE, 0);
}
else {
$output .= node_view($node, 0, FALSE, 0);
}
$output .= "</div>\n";
return $output;
}