comment-wrapper.tpl.php 1.96 KB
Newer Older
1
<?php
2

3
/**
4
 * @file
5
 * Provides an HTML container for comments.
6 7
 *
 * Available variables:
8 9 10
 * - $content: The array of content-related elements for the node. Use
 *   render($content) to print them all, or
 *   print a subset such as render($content['comment_form']).
11 12 13 14
 * - $classes: String of classes that can be used to style contextually through
 *   CSS. It can be manipulated through the variable $classes_array from
 *   preprocess functions. The default value has the following:
 *   - comment-wrapper: The current template type, i.e., "theming hook".
15 16 17 18 19 20
 * - $title_prefix (array): An array containing additional output populated by
 *   modules, intended to be displayed in front of the main title tag that
 *   appears in the template.
 * - $title_suffix (array): An array containing additional output populated by
 *   modules, intended to be displayed after the main title tag that appears in
 *   the template.
21 22
 *
 * The following variables are provided for contextual information.
23
 * - $node: Node entity the comments are attached to.
24 25 26
 * The constants below the variables show the possible values and should be
 * used for comparison.
 * - $display_mode
27 28
 *   - COMMENT_MODE_FLAT
 *   - COMMENT_MODE_THREADED
29 30 31 32
 *
 * Other variables:
 * - $classes_array: Array of html class attribute values. It is flattened
 *   into a string within the variable $classes.
33 34 35 36 37
 *
 * @see template_preprocess_comment_wrapper()
 * @see theme_comment_wrapper()
 */
?>
38
<section id="comments" class="<?php print $classes; ?>"<?php print $attributes; ?>>
39
  <?php if ($content['comments'] && $node->type != 'forum'): ?>
40
    <?php print render($title_prefix); ?>
41
    <h2 class="title"><?php print t('Comments'); ?></h2>
42
    <?php print render($title_suffix); ?>
43 44 45 46 47
  <?php endif; ?>

  <?php print render($content['comments']); ?>

  <?php if ($content['comment_form']): ?>
48 49
    <h2 class="title comment-form"><?php print t('Add new comment'); ?></h2>
    <?php print render($content['comment_form']); ?>
50
  <?php endif; ?>
51
</section>