0

I have a problem with the recent comments block created with Views. I have overridden the view fields in the view template (views-view-fields--comments-recent--block.tpl.php) and printed out the fields:

print '<div class="subj">'. $fields['subject']->content .'</div>';
print '{ <span> '.$fields['name']->content. '</span>' .', '. '<span>'. $fields['timestamp']->content .'</span> }';

It displays the name of user that created that node. For example, I've created a node titled "blahblahblah" and I added a comment on my node; the block displays "blahblah - posted by heihachi." If another user (jessica) posts a comment in that node, the block still displays " blahblah - posted by heihachi," not "by jessica."
Why?

1

This is because the title and author being shown belongs to the node not the comment. There are some options under the comment group of a views fields or you can use a relationship to specify the node's author or the comment's author.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.