Number of comments (CGFeedback)
Number of comments (CGFeedback)
Hello!
How to display number of comments (CGFeedback module) relevant to a page, in a page template?
How to display number of comments (CGFeedback module) relevant to a page, in a page template?
Re: Number of comments (CGFeedback)
from the CGFeedback Help:
(optional) pagelimit="10000" - Applicable only to the summary action, this parameter specifies the number of comments to display.
Re: Number of comments (CGFeedback)
Hmm. This is the LIMIT for the number of comments to display. But I need the EXACT number of comments which are made for a page.jmcgin51 wrote: from the CGFeedback Help:(optional) pagelimit="10000" - Applicable only to the summary action, this parameter specifies the number of comments to display.
(Sorry for my English

Re: Number of comments (CGFeedback)
how about {$comments|@count}?
(untested, just a guess)
(untested, just a guess)
Re: Number of comments (CGFeedback)
yes, got it! thank you:)
Re: Number of comments (CGFeedback)
cool - sometimes a lucky guess is all it takes...
Re: Number of comments (CGFeedback)
That didn't work for me! How did you include this in the template?
My piece of code in the template is:
What am I doing wrong??
My piece of code in the template is:
Code: Select all
{if $entry->summary}
<div class="CGBlogSummarySummary">
{eval var=$entry->summary}
</div>
{else if $entry->content}
{eval var=$entry->content}<br /><a href="{$entry->detail_url}" title="{$entry->title|escape:htmlall}">[Read Entry]</a> - {$comments|@count}
{/if}
Re: Number of comments (CGFeedback)
I've done it in the following way (may be not the optimal but works
)
In my News summary template:
And the template called 'counter' is defined in CGFeedback summary templates:

In my News summary template:
Code: Select all
Number of comments: {CGFeedback key1='News' key2=$entry->id action='summary' summarytemplate='counter'}
Code: Select all
{$total_records}
Re: Number of comments (CGFeedback)
Didn`t work for me too.That didn't work for me! How did you include this in the template?
I did it the way paulermo said (works)
Perhaps one of the smarty-gurus can help?
Last edited by derNager on Thu Nov 05, 2009 2:01 pm, edited 1 time in total.
Re: Number of comments (CGFeedback)
I have
Ronny
in the CGBlog summary-template. That returns the # of comments already IIRC...{CGFeedback key1="CGBlog" key2=$entry->id action='ratings'}
Ronny
Re: Number of comments (CGFeedback)
Hi Ronny, this solution ALMOST worked, but the output is this:
We only wan't "Number of Comments", and therefore paulermo's solution really works, but calls the CGEFeedback twice and we'd like to know if this is necessary.
Cheers guys!
jw
Code: Select all
Number of Comments: 0
Minimum Rating Value:
Maximum Rating Value:
Average Rating Value:
Cheers guys!
jw
Re: Number of comments (CGFeedback)
It uses the ratings=template, so you can take a copy of that one in CGFeedback, and remove the things you dont want to see.
Ronny
Ronny
Re: Number of comments (CGFeedback)
Jeo i did that but it still doesnt work for me.
I removed all things i dont need and it always shows "Anzahl der Kommentare 0" (thats german for comments 0
)
Is it important where i input {CGFeedback key1="CGBlog" key2=$entry->id action='ratings'} ?
Or if the site is cached or not?
I removed all things i dont need and it always shows "Anzahl der Kommentare 0" (thats german for comments 0

Is it important where i input {CGFeedback key1="CGBlog" key2=$entry->id action='ratings'} ?
Or if the site is cached or not?
Re: Number of comments (CGFeedback)
Tks Ronny, that worked!!
(I didn't see the Ratings template before, sorry)
Nager,
make sure your KEY1 ("CGBlog" or any other name) is the same you are using everywhere you use the Feedback module: {CGFeedback key1="CGBlog" key2=$entry->id action='ratings'} - Otherwise it will always say "0 comments"!
PS - ich weiss was "Anzahl der Komentare" heisst!

Nager,
make sure your KEY1 ("CGBlog" or any other name) is the same you are using everywhere you use the Feedback module: {CGFeedback key1="CGBlog" key2=$entry->id action='ratings'} - Otherwise it will always say "0 comments"!
PS - ich weiss was "Anzahl der Komentare" heisst!

Re: Number of comments (CGFeedback)
Finally thanks Ronny & jwaldeck 
bad copy and paste. I use the News Modul not CGblog.... Now everything is fine. thanks a lot
Ps: Wenn man jetzt wüste was "Ich nehme alles zurück und behaupte das Gegenteil" auf English heisst.
I think this is solved.

bad copy and paste. I use the News Modul not CGblog.... Now everything is fine. thanks a lot
Ps: Wenn man jetzt wüste was "Ich nehme alles zurück und behaupte das Gegenteil" auf English heisst.
I think this is solved.