theme_node_preview

Versions
4.6 – 6
theme_node_preview($node)
7
theme_node_preview($variables)

Display a node preview for display during node creation and editing.

Parameters

$node The node object which is being previewed.

Code

modules/node.module, line 1540

<?php
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 "&lt;!--break--&gt;" (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;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.