Comment.tpl.php

Last modified: April 5, 2009 - 00:07

Define the HTML for a comment block. This doesn't have anything to do with comment threading, just the actual comment.

Available variables

$author
Link to author profile.
$comment (object)
Comment object as passed to the theme_comment function.
$content
Content of link.
$date
Formatted date for post.
$directory
The directory the theme is located in, e.g. themes/garland or themes/garland/minelli.
$id
The sequential ID of the comment being displayed.
$is_front
True if the front page is currently being displayed.
$links
Contextual links below comment.
$new
Translated text for 'new', if the comment is in fact new.
$picture
User picture HTML (include <a> tag.) , if display is enabled and picture is set.
$submitted
Translated post information string.
$title
Link to the comment title.
$zebra
Alternates between odd/even in a list.

Default template

<div class="comment<?php print ($comment->new) ? ' comment-new' : ''; print ($comment->status == COMMENT_NOT_PUBLISHED) ? ' comment-unpublished' : ''; ?> clear-block">
  <?php print $picture ?>

<?php if ($comment->new) : ?>
  <a id="new"></a>
  <span class="new"><?php print $new ?></span>
<?php endif; ?>

  <h3><?php print $title ?></h3>

  <div class="submitted">
    <?php print $submitted ?>
  </div>

  <div class="content">
    <?php print $content ?>
  </div>

  <?php print $links ?>
</div>

 
 

Drupal is a registered trademark of Dries Buytaert.