Hi,

I am very much interested in adding the node title along side with the comment author and the comment title.
Could anyone post a patch or suggest some code?

Thanks,
Yossi.

Comments

todd nienkerk’s picture

Status: Active » Fixed

I've improved the themeable function that renders the links to comments in the final release (5.x-1.0). Here's what it looks like now:

/**
 * Return a link to the comment.
 *
 * @param $comment
 *   The comment object from _pressflow_recentcomments_getcontent().
 */
function theme_pressflow_recentcomments_link($comment) {
  $link_text = '';

  if (!empty($comment->name)) {
    $link_text .= $comment->name .': ';
  }

  // Theming example: Use the node's title in the comment link
  /*
  $node = node_load($comment->nid);
  $link_text .= $node->title . ': ';
  */

  $link_text .= $comment->subject;

  return l($link_text, 'node/' . $comment->nid, array(), NULL, 'comment-' . $comment->cid);
}

@yossilac: I've included a commented-out portion of code that will display the title of the node. Instead of changing the code in the module, you should (as always) override this themeable function in your theme's template.php file. Simply copy the code above, change the name of the function from theme_pressflow_recentcomments_link() to MYTHEME_pressflow_recentcomments_link() where "MYTHEME" is the name of your theme. You can edit the code as you like from there.

yossilac’s picture

Works perfectly, thank you very much for the quick response :)

Yossi.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.