Jump to:

3460 Posts in 1064 Topics by 739 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Adding Comments to DataObjects

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

Page: 1 2 3
Go to End
Author Topic: 3422 Views
  • PokerVIP
    Avatar
    Community Member
    1 Post

    Re: Adding Comments to DataObjects Link to this 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?

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Adding Comments to DataObjects Link to this post

    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.

  • tv
    Avatar
    Community Member
    43 Posts

    Re: Adding Comments to DataObjects Link to this post

    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'),
    array(
    '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.

  • tv
    Avatar
    Community Member
    43 Posts

    Re: Adding Comments to DataObjects Link to this post

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

    3422 Views
Page: 1 2 3
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.