Guest User

Untitled

a guest
Dec 16th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. function node_form_build_preview($form, &$form_state) {
  2. $node = node_form_submit_build_node($form, $form_state);
  3. $form_state['node_preview'] = node_preview($node);
  4. }
  5.  
  6. /**
  7. *Output customized node preview on node edit and add forms.
  8. *
  9. * @return
  10. * This just outputs the Full node ignoring the teaser mode.
  11. */
  12. function YOURTHEME_node_preview($variables)
  13. {
  14. $node = $variables['node'];
  15. $elements = node_view($node, 'full');
  16. $full = drupal_render($elements);
  17. $output = '<div class="preview">';
  18. $output .= '<h3 class="post-preview" >' . t('Preview of your posting') . '</h3>';
  19. $output .= $full;
  20. $output .= "</div>n";
  21. return $output;
  22. }
Add Comment
Please, Sign In to add comment