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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Silverstripe 3.1 design problem


Go to End


3 Posts   1100 Views

Avatar
Aurélien Chappard - Deefuse

Community Member, 5 Posts

26 August 2015 at 2:08am

Edited: 26/08/2015 2:08am

Hello everyone,
I have a design problem with Silverstripe 3.1. I do not know how to do.
I have 3 DataObject: Newspaper, Interview and Post.
A Newpaper has several Interviews and several Post. How to make in the Newspaper ModelAdmin, I can manage the order of Interviews and Posts inside a single DataGrid Field?

  • Journal has_many Interview et Post
  • Post and Interview has_one Journal

Avatar
m4kx

Community Member, 5 Posts

1 September 2015 at 10:02am

Edited: 01/09/2015 10:06am

not sure to see exactly what you want but maybe this?

class JournalAdmin extends ModelAdmin {	
	private static $menu_title = 'Journal';	
	private static $url_segment = 'newspaper';
	private static $managed_models = array(
		'Journal',
		'Interview',
		'Post',
	);
}

but after reading again its more about displaying "interview" and "post" into the "journal" grid. isnt it?

Avatar
Aurélien Chappard - Deefuse

Community Member, 5 Posts

15 September 2015 at 12:26am

but after reading again its more about displaying "interview" and "post" into the "journal" grid. isnt it?
yes it is !

Upon reflection, I found a solution using 2 dataobjects wich extend one basic dataobject : http://www.sspaste.com/paste/show/55f6bcd860218