Jump to:

10931 Posts in 2614 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » Related Pages module?

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 342 Views
  • Double-A-Ron
    Avatar
    Community Member
    604 Posts

    Related Pages module? Link to this post

    I asked this question over in general, but I think it might have been a bit convoluted. When I think about it, quite simply what I want is a Related Pages module.

    Example:'
    1. Create a page
    2. There is a tab called "Related Pages"
    3. This tab has a table of every other page in the system
    4. This table has checkboxes for selecting pages that related to the current page.

    Anyone aware of anything out there?

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: Related Pages module? Link to this post

    AFAIK no module for it, but it would be pretty simple to add. A quick overview

    On your Page class define both the many_many relation and belongs_many_many

    private static $many_many = array(
    'RelatedPages' => 'Page
    );

    private static $belongs_many_many = array(
    'Related' => 'Page'
    );

    Then in your getCMSFields add a GridField instance for managing the RelatedPages relation. An example that covers relation grid fields is http://programs.edchipman.ca/silverstripe-modules/sortablegridfield/many-many-example/

  • thomas.paulson
    Avatar
    Community Member
    67 Posts

    Re: Related Pages module? Link to this post

    Hello Will

    You are really awesome.

  • Double-A-Ron
    Avatar
    Community Member
    604 Posts

    Re: Related Pages module? Link to this post

    Thanks Will,

    I'll give that a shot once I've finished upgrading this particular site to 3.x.

    342 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.