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.

Data Model Questions

Adding Comments to DataObjects


20 Posts   3460 Views


28 March 2012 at 6:03am Community Member, 1 Post

Any updates on this? Would love to be able to differentiate between data objects.

We currently have wordpress blogs on our site - could the new comments system for Silverstripe 3.0 be easily integrated with this or would it require a messy work around?

How long a wait are we looking at?


28 March 2012 at 7:19pm Forum Moderator, 5511 Posts

The comments module is live and working in 3.0 (apart from moderation and ajax posting) but not sure what you mean by integrate with the wordpress blog comments? There's currently no importer or exporter for comments and nothing on the roadmap for it.


5 December 2012 at 1:27am (Last edited: 5 December 2012 6:11am), Community Member, 44 Posts

Hi Willr

I am using DataObjects as Pages and would like to use your Comments extension.

I have installed it and the CommentsForm is showing up on my DataObjects after placing the appropriate configuration in mysite/_config file.

I am using the following to render my Post DataObjects as Pages:

public function view($request) {
$segment = $request->param('ID');

if ($obj = Post::get()->filter('URLSegment', $segment)->First()) :
switch ($obj->Type) {
case 'News-Post' :
return $this->renderWith(
array('PostsPage_view_news', 'Page'),
'Object' => $obj,
'Type' => $obj->Type,
'Title' => $obj->Title,
'Entry' => $obj->Entry

My question is how would I pass through the $CommentsForm into the Postspage_view_news page?

I have tried the following, but while the form is being rendered, it is not associating the comments made through a form w/ a particular dataobject. Baseclass on comments made are set to SiteTree and not Post.


5 December 2012 at 7:50am Community Member, 44 Posts

I was able to accomplish passing the form through the renderWith method using: 'CommentsForm' => $obj->CommentsForm().