Jump to:

3435 Posts in 1026 Topics by 866 members

Template Questions

SilverStripe Forums » Template Questions » How to Make a Page a Sub-Page of More than One Parent Page?

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

Page: 1
Go to End
Author Topic: 1114 Views
  • ginger
    Avatar
    Community Member
    9 Posts

    How to Make a Page a Sub-Page of More than One Parent Page? Link to this post

    I'm working on an encyclopedia-type of project and need some pages to be listed under more than one category. Is there a way to designate a page as a sub-page of more than one parent page?

  • schellmax
    Avatar
    Community Member
    126 Posts

    Re: How to Make a Page a Sub-Page of More than One Parent Page? Link to this post

    the silverstripe database structure won't allow more than one parent id for a page, but there are other possibilities:
    - use 'VirtualPage' in the sitetree (i was having problems with this one in previous silverstripe versions, can't say wheter it's doing fine now)
    - refactor your code using dataobjects (see the tutorials on this or just post here again in case you need further advice)
    hth

  • ginger
    Avatar
    Community Member
    9 Posts

    Re: How to Make a Page a Sub-Page of More than One Parent Page? Link to this post

    Thanks, I definitely need more advice. I haven't read the tutorial on dataobjects yet but I will.

    How does the VirtualPage work for what I want to do?

  • schellmax
    Avatar
    Community Member
    126 Posts

    Re: How to Make a Page a Sub-Page of More than One Parent Page? Link to this post

    i suppose you're using 'category' pages, such as 'food' and 'fruit'.
    so for a page called 'apple', you might first create the page in the sitetree as a child of 'food', then you could switch to 'fruit' and create a virtualpage there, pointing to the 'apple' page created under 'food'.

    as for the dataobject approach, you should work through tutorial 5, but make sure you're already familiar with the concepts explained in the previous tutorials (except tutorial 4 maybe).

  • ginger
    Avatar
    Community Member
    9 Posts

    Re: How to Make a Page a Sub-Page of More than One Parent Page? Link to this post

    Hey, that's great. The VirtualPage option seems to be just fine. One question - will it create issues of duplicate content in search engines?

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