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.

Template Questions /

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

Layout Template Selection


Go to End


1642 Views

Avatar
StuM

Community Member, 59 Posts

4 March 2011 at 5:05pm

Edited: 04/03/2011 5:06pm

Hi All,

I have a site that uses 2 themes, one for desktop and one for mobile. I'm in the early stages so are currently just using Blackcandy for both.

I have a page class called a ProductPage. I want a common layout loaded for this that both themes can use, so I don't want to duplicate that template. So I have the following structure which I thought would work:

1. in mysite/_config.php => project = 'mysite'
2. sub-template => mysite/templates/Layout/ProductPage.ss

I assumed(and I'm sure I've done it before) that it would look in this order:

1. /themes/blackcandy/Layout/ProductPage.ss
2. /mysite/templates/Layout/ProductPage.ss
3. /themes/blackcandy/Layout/Page.ss

as it is, it displays #3, #1 isn't there and it doesn't seem to be able to find #2.

Is there a way I can achieve this?