solved Group Discussions - Reply Count

PatriaCo
PatriaCo
@the-patria-company
8 years ago
349 posts
Is it possible to have a bit of code print out the reply count in a thread?

I am going to use a bit of js and css to hide the indented discussion replies (as they are getting quite long and hard to follow) and I would like to add the count (hide/display) link beside the "Reply" link (as an example 8 is representing the count I would like the code to generate):

Reply || View/Hide Replies: 8

Thanks!


--
The Patria Company - patriaco.com / quality-trades.com / a-t.life - doing Jamroom since v3

updated by @the-patria-company: 11/17/16 04:31:11PM
SteveX
SteveX
@ultrajam
8 years ago
2,584 posts
It depends which template and module you are doing this in - try putting debug in your template to see what's available.

It will probably be something like {$item.discuss_comment_count}


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
paul
@paul
8 years ago
4,326 posts
The smarty variable will be {$item.discuss_comment_count}
Add in a default modifier in case of no comments yet (in which case the variable may not be created - {$item.discuss_comment_count|default:0}
hth


--
Paul Asher - JR Developer and System Import Specialist
PatriaCo
PatriaCo
@the-patria-company
8 years ago
349 posts
I think I found a problem. I have an active discussion board with 37 replies in it. The screenshot shows a replies count of - 75. the url is /group_discuss/group_id=XX --- it is the page that lists the discussions available. I am not sure of the tpl file.

{$item.user_jrAction_item_count} => "37" shows the correct item count (but this might be coincidental)

Back to my original question... I am looking for the count of replies per comment
{$item.discuss_comment_count} does not exist in the item_list.tpl when I do a {debug}

does this mean it is impossible?


--
The Patria Company - patriaco.com / quality-trades.com / a-t.life - doing Jamroom since v3
paul
@paul
8 years ago
4,326 posts
What template are you putting the {debug} in, and where? Remember that this is a group discussion listing variable so if you are looking at the jrGroup item_detail template there is another jrCore_list call for discussions so the {debug} needs to go in that template code. In the default group item_detail template that would be on line 71


--
Paul Asher - JR Developer and System Import Specialist

Tags