Display node comments

ShannonK - July 1, 2009 - 18:22
Project:Quick Tabs
Version:6.x-3.x-dev
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

I'm using Quicktabs to display some blocks and some nodes. One of the tabs is labeled "Updates" and the idea is to have certain Users click the tab and be able to input updates (text and photos). I thought a Story node would be one way to do this. As admin, I can enter text to the node and it appears correctly. However, when a User or even me as Admin clicks the Updates tab there isn't an "Add comment" link. The text I typed in as admin shows up, but nothing else. I checked Content Type: Story to make sure read/write was enabled, and Permissions to make sure "Create story content" was selected for authenticated users. Those are set correctly. The funny thing is, if I go to the node directly (www.example.com/node/78) then all comments show up. The only way to view them though, would be to type the exact URL in the address bar or use the Recent Comments block. So I'm guessing this is something with Quicktabs?

#1

Pasqualle - July 1, 2009 - 23:35
Title:posted comments not displaying for Quicktab node» Display node comments
Version:6.x-2.0-rc3» 6.x-3.x-dev
Category:support request» feature request

you are right, comments are not displayed with nodes.

The problem is that we use the node_view() function, which does not display comments. A new option "Display node comments" is required for node type tabpages, like it is in views.

the corresponding code from views module:

  if (!empty($options['comments']) && function_exists('comment_render')) {
    $vars['comments'] = comment_render($node);
  }

#2

ShannonK - July 2, 2009 - 00:17

So, can I enter this code somewhere to be able to see the comments? If so, where?

Or, do you have another suggestion for how I can accomplish this (a tab that allows comments or User input)?

Thank you for your help.

#3

Pasqualle - July 2, 2009 - 00:24

you can hack the module if you like.

in quicktabs.module after line 497 $output = node_view(...

insert this code:

            if (function_exists('comment_render')) {
              $output .= comment_render($node);
            }

#4

ShannonK - July 5, 2009 - 00:54

You're awesome! That works great. I'm new enough to all this I didn't understand the first comment...but #3 did the trick.

Thank you!

 
 

Drupal is a registered trademark of Dries Buytaert.