0

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.

Thanks.

  • 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 Dec 10 '12 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 Dec 10 '12 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 Dec 10 '12 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 Dec 10 '12 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 Dec 11 '12 at 8:31
0

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, privacy policy and cookie policy

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