Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Counting Approved comments

Go to End

3 Posts   1768 Views

Adam .

Community Member, 2 Posts

27 March 2013 at 3:12am

I'm using the blog module and I need to get a count of all the comments that have been moderated/approved. I'm currently using $Comments.Count but that counts all comments not the just the moderated comments. Does anyone know how i can count just the moderated comments?

Adam .

Community Member, 2 Posts

28 March 2013 at 12:32am


add this to BlogEntry.php

public function getApprovedComments(){
	return $this->Comments('Comment.Moderated = 1');


Community Member, 21 Posts

27 June 2013 at 2:38pm

I'd like to add for clarity that you now need to call ApprovedComments in your template.