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

adding Pages over Admincenter to other Pages


Go to End


9 Posts   1765 Views

Avatar
benni91

Community Member, 72 Posts

14 September 2011 at 12:37am

Hi,

i think the headline is very confusing :D

So let me explain you what i mean/want :)

I've got two Pagetypes
1. ReferencePage -> containing a Headline($RefHeadline), Previewimage($RefPreview) and some Text($RefContent)
There's one ReferencePage for each Reference

2. ServicesPage -> containing 10 different tabs in the Admincenter with the different Services.
There's one ServicesPage for all Services

Ok, I thought about adding a method to each service tab to select one or multiple ReferencePages and import the variables $RefHeadline and $RefPreview to the chosen tab and finally showing the output of the ReferencePage variables on ServicesPage under the before chosen tab.

The intent is, adding work examples to the belonging service.

Can someone help me build this?

Benni

Avatar
danzzz

Community Member, 175 Posts

14 September 2011 at 1:09am

I think I checkd what you mean :-)
You build a homepage for webagency which offers 10 services and for each service you can have x references?

If so it would be better to also create one ServicePage for each Service and then work with relations.

A ServicePage has_many References and a Reference has_one Service.

http://doc.silverstripe.org/sapphire/en/topics/datamodel

Avatar
benni91

Community Member, 72 Posts

14 September 2011 at 7:32pm

Sry i forgot to say, that I want to do that with out changing the ... ähmm ... type of service pagetype? I don't won't each service to be a single page.

Is that possible?

Avatar
danzzz

Community Member, 175 Posts

14 September 2011 at 9:06pm

there are always ways to do it ... but much more difficult.
10 tabs in backend does not mean that you can also have a relation to references for each service.

can you post your model config (DB) fields of both page types?

Avatar
benni91

Community Member, 72 Posts

14 September 2011 at 9:27pm

Of Course :-)

http://www.pastie.org/2530856 => ReferencePage
http://www.pastie.org/2530865 => ServicesPage

Avatar
benni91

Community Member, 72 Posts

16 September 2011 at 8:30am

and? some ideas? :)

Avatar
benni91

Community Member, 72 Posts

22 September 2011 at 1:02am

Helloooooo ;) ?

Avatar
martimiz

Forum Moderator, 1391 Posts

22 September 2011 at 3:18am

It's not that nobody wants to help you really - it's just that it isn't all that easy, the way you want to do it :-)

The difficulty lies in the fact that you need to set up 10 separate relations to sets of ReferencePages for your 10 tabs, and SilverStripe doesn't support multiple has_many/many_many relations to one and the same object all that well. An alternative might be using three objects like this:

- A ReferencePage
- A Service object that has_many ReferencePages (new)
- A ServicePage that has_many Services

Now you could use somethin like a ComplexTableField on your ServicePage to create the services.

Next you could either use a Service dropdown on your ReferencePages to link each ReferencePage to a Service (the easy way) Or you could create a multi-select kind of field on your Service-popup to link a set of ReferencePages to the Service (the hard way).

Go to Top