Number of comments (CGFeedback)

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
tyu
New Member
New Member
Posts: 7
Joined: Mon Aug 24, 2009 11:07 am

Number of comments (CGFeedback)

Post by tyu »

Hello!
How to display number of comments (CGFeedback module) relevant to a page, in a page template?
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Number of comments (CGFeedback)

Post by jmcgin51 »

from the CGFeedback Help:
(optional) pagelimit="10000" - Applicable only to the summary action, this parameter specifies the number of comments to display.
tyu
New Member
New Member
Posts: 7
Joined: Mon Aug 24, 2009 11:07 am

Re: Number of comments (CGFeedback)

Post by tyu »

jmcgin51 wrote: from the CGFeedback Help:
(optional) pagelimit="10000" - Applicable only to the summary action, this parameter specifies the number of comments to display.
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.

(Sorry for my English :) )
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Number of comments (CGFeedback)

Post by jmcgin51 »

how about {$comments|@count}?

(untested, just a guess)
tyu
New Member
New Member
Posts: 7
Joined: Mon Aug 24, 2009 11:07 am

Re: Number of comments (CGFeedback)

Post by tyu »

yes, got it! thank you:)
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Number of comments (CGFeedback)

Post by jmcgin51 »

cool - sometimes a lucky guess is all it takes...
jwaldeck

Re: Number of comments (CGFeedback)

Post by jwaldeck »

That didn't work for me! How did you include this in the template?

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}
What am I doing wrong??
paulermo
New Member
New Member
Posts: 3
Joined: Mon Nov 02, 2009 11:52 am

Re: Number of comments (CGFeedback)

Post by paulermo »

I've done it in the following way (may be not the optimal but works :))

In my News summary template:

Code: Select all

Number of comments: {CGFeedback key1='News' key2=$entry->id action='summary' summarytemplate='counter'}
And the template called 'counter' is defined in CGFeedback summary templates:

Code: Select all

{$total_records}
User avatar
derNager
Forum Members
Forum Members
Posts: 21
Joined: Sun Nov 01, 2009 4:05 pm

Re: Number of comments (CGFeedback)

Post by derNager »

That didn't work for me! How did you include this in the template?
Didn`t work for me too.

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.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Number of comments (CGFeedback)

Post by RonnyK »

I have
{CGFeedback key1="CGBlog" key2=$entry->id action='ratings'}
in the CGBlog summary-template. That returns the # of comments already IIRC...

Ronny
jwaldeck

Re: Number of comments (CGFeedback)

Post by jwaldeck »

Hi Ronny, this solution ALMOST worked, but the output is this:

Code: Select all

Number of Comments: 0
Minimum Rating Value: 
Maximum Rating Value: 
Average Rating Value: 
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
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Number of comments (CGFeedback)

Post by RonnyK »

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
User avatar
derNager
Forum Members
Forum Members
Posts: 21
Joined: Sun Nov 01, 2009 4:05 pm

Re: Number of comments (CGFeedback)

Post by derNager »

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?
jwaldeck

Re: Number of comments (CGFeedback)

Post by jwaldeck »

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! :)
User avatar
derNager
Forum Members
Forum Members
Posts: 21
Joined: Sun Nov 01, 2009 4:05 pm

Re: Number of comments (CGFeedback)

Post by derNager »

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.
Post Reply

Return to “Modules/Add-Ons”