Hello. I was wondering if there was a way to change the title "Comments" on certain nodes or content types to another title. For example, if I wanted to change "Comments" to "Complaints" or "Feedback" etc.

I don't want to do it on theme level because it would change things sitewide and even in the forums it would give the grouping "Feedback" or whatever.

Also, is there a way to aggregate the comments on a separate page using just Nodecomments or do you have to use views? For example, I have my comments set to display only one comment per page, however, every page now has one comment (naturally.) Is it only views that can provide a "more" link instead of the pagination 1, 2, ... n? I figure since the comments are all nodes there may be a way to display a list of comments for a particular node on another results-type page.

If I need views, that's fine but I would like to ask one more thing in that case and that is how to stop printing the auto pagination so I could implement my own view output and/or how to stop printing the comments results altogether but still allow users to comment.

Thanks. I know some of this would be better asked in Views but if you could answer the questions about Nodecomments I can always go and ask over there if you think none of this is possible with Nodecomments.

Cheers

Comments

lobo235’s picture

I am looking to do the same thing and I can't find a solution anywhere. Did you happen to find a way to do this?

RKS’s picture

The only way I found is in the .tpl.php for my node. I hid the regular comments with hide($content['comments']) and then in the section I wanted the "comments" label I used <a href="#feedback"><?php print t('Feedback'); ?> (<?php print $content['body']['#object']->comment_count; ?>)</a> Where I wanted the comments (in a tab under the label) I used print render($content['comments']);

Hopefully you can do the same thing for your needs. It still says add a comment but I figure users will get it since they have to click the "Feedback" tab to see the "add a new comment"

lobo235’s picture

After I left my comment I was able to find a solution that worked for us. You can override the comments-wrapper.tpl.php file in your custom theme which allows you to output your own title. Here is what we put in our comments-wrapper.tpl.php file:

<?php
  if($node->type == 'question') {
    $comment_type = 'Answer';
    $comment_type_plural = 'Answers';
       
  }
  else {
    $comment_type = 'Comment';
    $comment_type_plural = 'Comments';
  }
?>
<div id="comments">
  <h2 class="title">
    <?php print $node->comment_count.' '.($node->comment_count == 1 ? $comment_type : $comment_type_plural); ?>
  </h2>
  <?php print $content; ?>
</div>

As far as changing the 'Add new Comment' link to something else goes, I'm not exactly sure how you can do it easily/elegantly.

RKS’s picture

That works too. My original thinking was comments.tpl would be global but I didn't think of else/if with node type.

I'm still interested in the "add a new comment" change, and will check back to see if anyone has a solution.

RKS’s picture

Thanks, BTW. I'll remember this in future sites where I already haven't done it the backwards way.

crea’s picture

Status: Active » Fixed

Node comments are nodes. You can do anything with them using Views, but you may have to override some Node Comments features.

Status: Fixed » Closed (fixed)

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