comment-wrapper.tpl.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * @file
  4. * Default theme implementation to wrap comments.
  5. *
  6. * Available variables:
  7. * - $content: The array of content-related elements for the node. Use
  8. * render($content) to print them all, or print a subset such as
  9. * render($content['comment_form']).
  10. * - $classes: String of classes that can be used to style contextually through
  11. * CSS. It can be manipulated through the variable $classes_array from
  12. * preprocess functions. The default value has the following:
  13. * - comment-wrapper: The current template type, i.e., "theming hook".
  14. *
  15. * The following variables are provided for contextual information.
  16. * - $node: Node object the comments are attached to.
  17. * The constants below the variables show the possible values and should be
  18. * used for comparison.
  19. * - $display_mode
  20. * - COMMENT_MODE_FLAT
  21. * - COMMENT_MODE_THREADED
  22. *
  23. * Other variables:
  24. * - $classes_array: Array of html class attribute values. It is flattened
  25. * into a string within the variable $classes.
  26. *
  27. * @see template_preprocess_comment_wrapper()
  28. */
  29. ?>
  30. <div id="comments" class="<?php print $classes; ?>"<?php print $attributes; ?>>
  31. <?php $comments = render($content['comments']); ?>
  32. <?php if ($node->type != 'forum' && !empty($comments)): ?>
  33. <div class="page-header">
  34. <h2 class="title"><?php print t('Comments'); ?></h2>
  35. </div><!--/.page-header-->
  36. <?php endif; ?>
  37. <?php print $comments; ?>
  38. <?php if ($content['comment_form']): ?>
  39. <div class="page-header">
  40. <h2 class="title comment-form"><?php print t('Add new comment'); ?></h2>
  41. </div><!--/.page-header-->
  42. <?php print render($content['comment_form']); ?>
  43. <?php endif; ?>
  44. </div><!-- /comments -->