Is there any way to create panels template for comments (comments attached to node). So far I've only found that "Node comments" thing under the node tab (Variants -> content) which outputs default comments and Mini panels block which renders only one comment from random node.

I'm trying replace forum node template with panels and render node and comments with same layout.


  • I dont have the time to figure out the details at the moment, but it is definitely possible. I don't understand "renders default comments", and I very much doubt there is a Panels provided pane that renders random content.
    – Letharion
    Commented Dec 10, 2012 at 16:58
  • With default comments output I meant the same as print render($content['comments']); in node.tpl.php and with that "Mini panels" thing I meant Mini panels block with the following settings: i.imgur.com/rPSiE.jpg which obviously doesn't work because it has no relation to that node we are viewing.
    – naw
    Commented Dec 10, 2012 at 17:26
  • I must be missunderstanding still, how is $content['comments'] not what you need? You can add the relation to the minipanel, and it will output the same thing.
    – Letharion
    Commented Dec 10, 2012 at 20:16
  • I've never used panels before, so that might really be what I need but I just don't know it yet. The thing I'm trying to do is: replace comment with same panels layout I'm using to view nodes (show comment fields to be more precise). That $content['comments'] outputs comments exactly same way the theme does and that should be replaced with mini panels or anything that let me put each comment field where I want to. Ie. comment title to the top and username to the left and comment body to the left etc.
    – naw
    Commented Dec 10, 2012 at 21:53
  • Ah, I see. There's no out of the box solution for that. Nodes are a special case as they have been the most used element. Historically, one had to write a great deal of element specific code. In D7 it should be possible to generalize this to any entity, but I don't believe that has been done.
    – Letharion
    Commented Dec 11, 2012 at 8:31

1 Answer 1


There's no out of the box solution for doing this today.

If you look at a file like ctools/plugins/content_types/node_context/node_links.inc you'll see how it's done for nodes and their links. The other files in the same directory do the same but to different pieces of nodes. For historic reasons, there's a lot of Node specific content in there.

Today it should be possible to generalize the same approach onto all entities, but as far as I know, that hasn't happened anywhere.

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.