Jump to:

23483 Posts in 18965 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » adding Pages over Admincenter to other Pages

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

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

Page: 1 2
Go to End
Author Topic: 951 Views
  • benni91
    Avatar
    Community Member
    72 Posts

    adding Pages over Admincenter to other Pages Link to this post

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

  • danzzz
    Avatar
    Community Member
    175 Posts

    Re: adding Pages over Admincenter to other Pages Link to this post

    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

  • benni91
    Avatar
    Community Member
    72 Posts

    Re: adding Pages over Admincenter to other Pages Link to this post

    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?

  • danzzz
    Avatar
    Community Member
    175 Posts

    Re: adding Pages over Admincenter to other Pages Link to this post

    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?

  • benni91
    Avatar
    Community Member
    72 Posts

    Re: adding Pages over Admincenter to other Pages Link to this post

    Of Course

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

  • benni91
    Avatar
    Community Member
    72 Posts

    Re: adding Pages over Admincenter to other Pages Link to this post

    and? some ideas?

  • benni91
    Avatar
    Community Member
    72 Posts

    Re: adding Pages over Admincenter to other Pages Link to this post

    Helloooooo ;) ?

  • martimiz
    Avatar
    Forum Moderator
    1086 Posts

    Re: adding Pages over Admincenter to other Pages Link to this post

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

    951 Views
Page: 1 2
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.