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

How to include Page.ss?


Go to End


3 Posts   1453 Views

Avatar
mikeyc7m

Community Member, 19 Posts

10 February 2015 at 1:36pm

I have Layout/Homepage.ss and I want it to include the Layout/Page.ss
<% include Page %>
but this injects the entire templates/Page.ss code instead. How do I include Layout/Page.ss?

Avatar
martimiz

Forum Moderator, 1391 Posts

11 February 2015 at 1:29am

Edited: 11/02/2015 1:30am

You could also just copy the contents of Page.ss to /Includes/PageLayout.ss, and then use <% include PageLayout %> in both Page.ss and HomePage.ss. I sort of feel that would also be a bit more in line with the 'standard SilverStripe way'...

Avatar
mikeyc7m

Community Member, 19 Posts

11 February 2015 at 1:41am

I suppose that is the sensible solution to an oddity which I will just have to live with.