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.

All other Modules

Discuss all other Modules here.

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

$pageComments Question


Reply

2 Posts   568 Views

Avatar
fengdeadshot

2 April 2011 at 2:43am Community Member, 6 Posts

Hi guys, I was wondering how the $pageComments works from the behavior tab?
I mean how you just put the variable where you want comments displayed and then enable it,
and BAM it works...

I'm trying to make a JQueryImageCarousel Drop in module,
I kinda wanna get it working much like the pageComments where you can drop and go.
Any ideas, or know how about how this works?

I'm going through the documentation and such now, but if someone knows that would be great.

Avatar
Willr

2 April 2011 at 6:00pm Forum Moderator, 5511 Posts

I mean how you just put the variable where you want comments displayed and then enable it,
and BAM it works...

Yes this is how it works. If you want an example of how you should do it check out the new comments module (https://github.com/silverstripe/silverstripe-comments) or more specifically the function https://github.com/silverstripe/silverstripe-comments/blob/master/code/extensions/CommentsExtension.php will help.

How this works is adds an extension to a Page object (via the comments/_config.php). That extension (which I linked above) has several functions like $CommentsForm which can be called (since that extension is now on the object).