I'm trying to customize <p class="comment-submitted"><?php print $submitted;

to remove some parts that I don't need.

I used the line

<span class="submitted"><?php print t('Submitted by !username on !datetime', array('!username' => $name, '!datetime' => $date)); 

from this post http://drupal.org/node/1244912#comment-4849422. But I only got "Submitted by on", the username and date didn't show.

Also how do I print the permalink? Thanks!

Comments

Jeff Burnz’s picture

In AT this is handled in preprocess, add this to template.php and clear the cache. Thereafter you can add/remove bits as needed.

function corolla_preprocess_comment(&$vars) {
  $vars['submitted'] = t('Submitted by !username on !datetime',
    array(
      '!username' => $vars['author'],
      '!datetime' => '<time datetime="' . $vars['datetime'] . '" pubdate="pubdate">' . $vars['created'] . '</time>',
    )
  );
}
giorgio79’s picture

Jeff Burnz’s picture

Did you test that module with this theme?

giorgio79’s picture

Not yet. The module says we need to make sure we have "theme('node_submitted')"

fehin’s picture

Status: Active » Closed (fixed)

Thanks Jeff. I got it to work.