comment.tpl.php

  1. 7.x drupal-7.x/modules/comment/comment.tpl.php
  2. 7.x drupal-7.x/themes/garland/comment.tpl.php
  3. 7.x drupal-7.x/themes/bartik/templates/comment.tpl.php
  4. 6.x drupal-6.x/modules/comment/comment.tpl.php
  5. 6.x drupal-6.x/themes/bluemarine/comment.tpl.php
  6. 6.x drupal-6.x/themes/pushbutton/comment.tpl.php
  7. 6.x drupal-6.x/themes/garland/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
theme_comment_view in drupal-6.x/modules/comment/comment.module
Themes a single comment and related items.

File

drupal-6.x/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>