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.

Template Questions /

Shared content


Reply


3 Posts   994 Views

Avatar
hhxbox

Community Member, 2 Posts

29 October 2009 at 6:25am

Edited: 29/10/2009 7:43am

I would like to have a.ss template for page 'a' and b.ss and c.ss for pages 'b' and 'c' that will use a.ss.
So my page can be type 'a', 'b' or 'c', but 'b' and 'c' will just use 'a'.
In the other words I am trying to create shared content on 'b' and 'c' pages and have page 'a' be child of multiple parents 'b' and 'c'.

Is this best way to do it and what is the most efficient way to implement this anyway?
My only requirement is that page type 'a' has to be independent so it does not belong to neither of those pages.

Avatar
zenmonkey

Community Member, 532 Posts

29 October 2009 at 7:59am

Not exactly sure what you're getting at here. If this is a template issue and just display you can share layouts elements through includes.

http://doc.silverstripe.org/doku.php?id=templates
http://doc.silverstripe.org/doku.php?id=tutorial:2-extending-a-basic-site#creating_the_templates

Or are you trying to share data between different page types. Are A B C different pagetypes as in each is its own unique class or are they just layout templates that get called depending on the parent page? Because you may be able to pull off what you want with a <% control Parent %> to pull data from the parent page

Avatar
hhxbox

Community Member, 2 Posts

29 October 2009 at 8:58am

Thank you for your reply.
I am new at this and I guess I got it all wrong.
Basically I am trying to have multiple parents for one child,
where child will supply parents with content but parents will have
different background color, banner, side menu etc ..

tx again