Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is there a way to show the comment count in my template? I searched through the module code and don't see anything that references the comment count so I don't believe it's a current feature. Just wondering.
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#11 | 590582-11-disqus_count_anywhere.patch | 5.18 KB | Grayside |
#9 | 590582-9-disqus_count_anywhere.patch | 3.85 KB | Grayside |
#8 | 590582-8-disqus_count_anywhere.patch | 3.79 KB | Grayside |
Comments
Comment #1
interestingaftermath CreditAttribution: interestingaftermath commentedI have 1/2 way answered my question.
That will display the comments and reactions. Now any suggestions on how to hide that unless there are comments or reactions?
Comment #2
RobLoachYay! You can probably change how 0 comments show up in the Disqus administration section. Out of scope for this module, unfortunately. Would have to be on the Disqus end.
Comment #4
basvredelingYou can use:
print theme('disqus_comments_num', $node->disqus['domain'], $node->disqus['url']);
in Drupal 6Comment #5
ryan.gibson CreditAttribution: ryan.gibson commentedHow about a 7.x solution?
Comment #6
ryan.gibson CreditAttribution: ryan.gibson commentedComment #7
Grayside CreditAttribution: Grayside commentedThese seems like it should be a checkbox on the node settings, or possibly something integrated with managing field display.
Comment #8
Grayside CreditAttribution: Grayside commentedThere's some minimal work to be done here, as the current codebase does not provide the necessary API functionality to easily hack this. I want it more like an on-demand Views' field, which seems to take some more work. Attached patch does a basic refactor of existing code to at least isolate the behavior outside of Views.
Comment #9
Grayside CreditAttribution: Grayside commentedReroll
Comment #10
slashrsm CreditAttribution: slashrsm commentedCould we use the same function also in hoo_node_view where we add comment count to teasers?
Comment #11
Grayside CreditAttribution: Grayside commentedI took a quick look at this, and I think you can. I haven't tested this patch at all, but I think it just might work.
Note that the existing behavior in hook_node_view() adds the disqus information as "links" to the existing links structure. This patch replaces it as a singular link added to that structure.
Comment #12
slashrsm CreditAttribution: slashrsm commentedIt looks that this brakes teaser link. It simply disappears.
Comment #13
imanoop CreditAttribution: imanoop as a volunteer and commentedYou can get the comment_count from node_load($nid);
Comment #14
DamienMcKennaThis could use some minor refactoring to include the new Panels content_type plugin.