SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Mar 2010
    Location
    UK
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Name and date variables for comments, Drupal 7

    I'm using the following snippet to modify the display of publishing date and author's name info in Drupal 7 nodes:
    Code:
    $variables['submitted'] = t('Published by !username on !datetime', array('!username' => $variables['name'], '!datetime' => $variables['date']));
    I want to modify the same info for comments, specifically by shortening it to just name and date. I may be wrong, but it seems that the equivalent information for comments comes from different variables. The problem is that, despite a lot of searching, I can't find out what they are. Anyone know? If I can get those variables, the rest will be fairly straightfoward.

  2. #2
    SitePoint Addict
    Join Date
    Mar 2010
    Location
    UK
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Belated, but a stumbled across the answer when I was looking at the Framework theme. It uses something like the following code in the comment.tpl.php template.
    Code:
    <p class="submitted comment-name"><?php print $author; ?><br /><?php print $created; ?></p>
    Maybe that will help someone who searches for this as I did.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •