comment.tpl.php

  1. drupal
    1. 4.7 themes/bluemarine/comment.tpl.php
    2. 4.7 themes/pushbutton/comment.tpl.php
    3. 4.7 themes/engines/phptemplate/comment.tpl.php
    4. 5 themes/engines/phptemplate/comment.tpl.php
    5. 5 themes/bluemarine/comment.tpl.php
    6. 5 themes/garland/comment.tpl.php
    7. 5 themes/pushbutton/comment.tpl.php
    8. 6 themes/bluemarine/comment.tpl.php
    9. 6 modules/comment/comment.tpl.php
    10. 6 themes/pushbutton/comment.tpl.php
    11. 6 themes/garland/comment.tpl.php
    12. 7 themes/bartik/templates/comment.tpl.php
    13. 7 modules/comment/comment.tpl.php
    14. 7 themes/garland/comment.tpl.php
    15. 8 core/modules/comment/comment.tpl.php
    16. 8 core/themes/bartik/templates/comment.tpl.php

comment.tpl.php Default theme implementation for comments.

Available variables:

  • $author: Comment author. Can be link or plain text.
  • $content: Body of the post.
  • $date: Date and time of posting.
  • $links: Various operational links.
  • $new: New comment marker.
  • $picture: Authors picture.
  • $signature: Authors signature.
  • $status: Comment status. Possible values are: comment-unpublished, comment-published or comment-preview.
  • $submitted: By line with date and time.
  • $title: Linked title.

These two variables are provided for context.

  • $comment: Full comment object.
  • $node: Node object the comments are attached to.

See also

template_preprocess_comment()

theme_comment()

1 theme call to comment.tpl.php

File

modules/comment/comment.tpl.php
View source
  1. <?php
  2. /**
  3. * @file comment.tpl.php
  4. * Default theme implementation for comments.
  5. *
  6. * Available variables:
  7. * - $author: Comment author. Can be link or plain text.
  8. * - $content: Body of the post.
  9. * - $date: Date and time of posting.
  10. * - $links: Various operational links.
  11. * - $new: New comment marker.
  12. * - $picture: Authors picture.
  13. * - $signature: Authors signature.
  14. * - $status: Comment status. Possible values are:
  15. * comment-unpublished, comment-published or comment-preview.
  16. * - $submitted: By line with date and time.
  17. * - $title: Linked title.
  18. *
  19. * These two variables are provided for context.
  20. * - $comment: Full comment object.
  21. * - $node: Node object the comments are attached to.
  22. *
  23. * @see template_preprocess_comment()
  24. * @see theme_comment()
  25. */
  26. ?>
  27. <div class="comment<?php print ($comment->new) ? ' comment-new' : ''; print ' '. $status ?> clear-block">
  28. <?php print $picture ?>
  29. <?php if ($comment->new): ?>
  30. <span class="new"><?php print $new ?></span>
  31. <?php endif; ?>
  32. <h3><?php print $title ?></h3>
  33. <div class="submitted">
  34. <?php print $submitted ?>
  35. </div>
  36. <div class="content">
  37. <?php print $content ?>
  38. <?php if ($signature): ?>
  39. <div class="user-signature clear-block">
  40. <?php print $signature ?>
  41. </div>
  42. <?php endif; ?>
  43. </div>
  44. <?php print $links ?>
  45. </div>
Login or register to post comments