Jump to:

3373 Posts in 998 Topics by 712 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Related content - has_many relationship of same pagetype

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

Page: 1
Go to End
Author Topic: 913 Views
  • obj63mc
    Avatar
    Community Member
    24 Posts

    Related content - has_many relationship of same pagetype Link to this post

    Hi All,

    I am setting up a site that has categories, sub categories, and then articles. What I want to do is create a way for admins to select other articles on the site to be "related articles". When I tried to do so with a has many relationship -

    static $has_many = array('RelatedArticles' => 'ArticlePage');

    I then setup - a HasManyComplexTableField -

    $tablefield = new HasManyComplexTableField( $this, 'RelatedArticles',    'ArticlePage',    array('Title' => 'Title' ), 'getCMSFields_forPopup'    );

    $fields->addFieldToTab('Root.Content.RelatedArticles', $tablefield);

    When I do this though on the admin side all checkboxes are disabled.

    Does anyone know how to resolve this so that the check boxes will then be enabled.
           

    913 Views
Page: 1
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.