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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

Related Pages module?


Go to End


4 Posts   1933 Views

Avatar
Double-A-Ron

Community Member, 607 Posts

28 February 2014 at 10:01am

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?

Avatar
Willr

Forum Moderator, 5523 Posts

1 March 2014 at 11:21am

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/

Avatar
thomas.paulson

Community Member, 107 Posts

1 March 2014 at 6:56pm

Hello Will

You are really awesome.

Avatar
Double-A-Ron

Community Member, 607 Posts

5 March 2014 at 1:19pm

Thanks Will,

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