Hi,

Comment-wrapper.tpl.php is working fine in forum and all pages except on panel pages. Does anybody know why?
I can't find any info about this. I'll try to give as much info as possible:

On the panel pages the css looks like this:
...

Comments

...

In the forum the "

" is there and then the code in comment-wrapper.tpl.php

Why is this? Should not the comment-wrapper.tpl.php hook all comment related stuff?

Comments

invinnklas’s picture

Oops, sorry. The panel's css looks like this:

<div class="panel-pane">
<h2 class="title">Comments</h2>
<div class="content">
<a id="comment-33"/>
<div class="comment odd">
</div>
<a id="comment-34"/>
<div class="comment even">
</div>
</div>
</div>

The forum has:
<div id="comments"> and all the appropriate info from comment-wrapper.tpl.php

merlinofchaos’s picture

Status: Active » Fixed

Panels does not pass the comment data through comment-wrapper.tpl.php in favor of using the pane system. If you just need to add the 'comments' id, edit the CSS properties of the pane and add comments. Otherwise you can probably also override theme_panel_pane() for the pane to change the output a little.

invinnklas’s picture

Status: Fixed » Active

I need to use the comment-wrapper for the panels.

How would I go by overriding the theme_panel_pane() in order for the panes to load comment-wrapper.tpl.php?

moe_san’s picture

I'm having the same problem. Did you find a solution? Thx.

merlinofchaos’s picture

Priority: Critical » Normal
Status: Active » Closed (works as designed)

Sorry, if you really need the comment-wrapper you'll need to create a custom content type or theme panels-pane as suggested. It does not work well with panes by default and would cause problems, which is why I elected to skip it.

fuerst’s picture

Since the node_comments pane is empty you can not use theme_panels_pane() when you want to theme the empty node_comments pane too.

I instead used theme_panels_default_style_render_panel() to inject some empty HTML code:

/**
 * Panels default style modifizieren
 *
 * @return void
 * @author Bernhard Fürst
 */
function YOURTHEME_panels_default_style_render_panel($display, $panel_id, $panes, $settings) {
  foreach ($panes as $pane) {
    if ('node_comments' == $pane->type && '' == $pane->content) {
      $pane->content = '<div class="empty"><p>No comments so far.</p></div>';
    }
  }
   
  return theme_panels_default_style_render_panel($display, $panel_id, $panes, $settings);
}

I think this is not optimal but I don't know any other way besides creating my own node_comments plugin for ctools. What do you think?

BTW: I did not find any documentation for theme_panels_pane() in Panels 3. In the end I tried http://api.lullabot.com/theme_panels_pane/5 and it worked. What is the status of this function in Panels 3?

Anonymous’s picture

Has there been any progress on this issue over the past few years, losing the comment.tpl.php when panels is selected for managing comment display is frustrating.

Anonymous’s picture

Just an fyi for anyone who finds this thread. You can use Display Suite to format the display of your comments and still have access to comment.tpl.php.