When creating a theme for a site, people often override comment-wrapper.tpl.php which contains both the comments, and the comment form. It would be great if we had the option of adding an equivalent content pane to a node_view panel page, which rendered the comments and the form through the comment-wrapper.tpl.php.

This is a fairly common use case I'm trying to solve with panels:
[node content]
[something in between]
[comments and comment form]

Right now the comments and the comment form are two separate panes which means that by adding them separately we loose all the cusomizations that were made via the comment-wrapper.tpl.php, making it really difficult to maintain consistency across the whole site when some nodes are using the default display and some are overridden.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jenlampton’s picture

Category: task » feature
Status: Active » Needs review
FileSize
3.72 KB

patchy. and I guess this is a feature request.

etiennechataignier’s picture

It works like a charm. Thanks a lot @jenlampton !

jenlampton’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @echataig! Next time you review something and it works as expected, can you change the issue status to 'reviewed & tested by the community' for us? :)

japerry’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work

It looks pretty good ,but needs some docblocks. Only has one review, and I'll add it to mine to review as well.

  1. +++ b/plugins/content_types/node_context/node_comment_wrapper.inc
    @@ -0,0 +1,103 @@
    +function ctools_node_comment_wrapper_content_type_render($subtype, $conf, $panel_args, $context) {
    

    Needs Docblock

  2. +++ b/plugins/content_types/node_context/node_comment_wrapper.inc
    @@ -0,0 +1,103 @@
    +function ctools_node_comment_wrapper_content_type_edit_form($form, &$form_state) {
    

    Needs Docblock

  3. +++ b/plugins/content_types/node_context/node_comment_wrapper.inc
    @@ -0,0 +1,103 @@
    +function ctools_node_comment_wrapper_content_type_edit_form_submit($form, &$form_state) {
    

    Needs Docblock

  4. +++ b/plugins/content_types/node_context/node_comment_wrapper.inc
    @@ -0,0 +1,103 @@
    +function ctools_node_comment_wrapper_content_type_admin_title($subtype, $conf, $context) {
    

    Needs Docblock

IshaDakota’s picture

Status: Needs work » Needs review
FileSize
4 KB
1.94 KB

An attempt at docblocks (and one whitespace fix).

hideaway’s picture

I am dependant on this, will we get it commited to dev?

jenlampton’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
3.97 KB

Great job @IshaDakota!

I added some whitespace before the * in the docblocks, and also added a check to see if the comment module exists (taken from node_comments plugin). I also compared the docblocks in this plugin to a few others, which was hard since most of them don't have any (ahem, node_comments). The ones in this patch are the most common (and are almost exactly the same as what @IshaDakota had!) so... marking as RTBC.

hideaway’s picture

when this is pushed? it's already reviewed and working and it's nice feature. I am using this for quite a while, but I am afraid it never will be really added to the repo.

japerry’s picture

Status: Reviewed & tested by the community » Fixed

Sweet, sorry I missed the revised patch. Fixed.

  • japerry committed e04baf8 on 7.x-1.x authored by jenlampton
    Issue #1771088 by jenlampton, IshaDakota: Provide equivalent content...

Status: Fixed » Closed (fixed)

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