4

I've got a content type with comments enabled for each node, and I've created a view that will just display all nodes of this type.

I'd like it for users to be able to add and view comments in this view. Currently, one solution is to set Row Style: Nodes, which gives me the full node and the comments; however I want to be able to tweak and control what is displayed on the node (such as shorten the date format, remove some fields).

The other alternative I've tried is to set Row Style: Field, which gives me control on what fields to display, but I can't see any way of getting comment functionality to appear.

What's the best way to address this problem?

2 Answers 2

1

You can bring in the comment details of the nodes listed using Relationships. Relationships brings in comments related to the current item in the view result. Which will start showing up in the add fields selection list.

Another option would be the same as what Kirk suggested. Instead of changing the tpl it would be a better idea to use panels then.

Panels is capable of bringing in comments for the current node displayed. You can also theme them as required. Also you can create multiple variants of display for the node like how we have full view and teaser, you can have your own custom variant. which can be selected based on certain conditions.

1

My suggestion is that you use the 'node' display, but make changes to your node.tpl.php file in your theme. This will give you the results that you want, but it obviously won't be very point-and-click.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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