21280 Posts in 5729 Topics by 2600 members
| Go to End | Next > | |
| Author | Topic: | 642 Views |
-
adding Pages over Admincenter to other Pages

14 September 2011 at 12:37am
Hi,
i think the headline is very confusing
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 Reference2. ServicesPage -> containing 10 different tabs in the Admincenter with the different Services.
There's one ServicesPage for all ServicesOk, 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
-
Re: adding Pages over Admincenter to other Pages

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.
-
Re: adding Pages over Admincenter to other Pages

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?
-
Re: adding Pages over Admincenter to other Pages

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?
-
Re: adding Pages over Admincenter to other Pages

14 September 2011 at 9:27pm
Of Course
http://www.pastie.org/2530856 => ReferencePage
http://www.pastie.org/2530865 => ServicesPage -
Re: adding Pages over Admincenter to other Pages

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 ServicesNow 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).
| 642 Views | ||
| Go to Top | Next > |


