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

Get multiple layouts to frontpage


Go to End


3 Posts   1368 Views

Avatar
quanto

Community Member, 91 Posts

8 August 2011 at 11:02pm

I'd like to get multiple pages to the frontpage. The Content, title et cetera is no problem. However, I can't include the attached Layout to it.

Is there any way to get several layouts to e.g. Home.ss?

Something like this:

<% control Menu(2) %> 
    <% include Layout.ss <-- doesn't work %>
    $Content
    $Form
<% end_control %>

Avatar
MarcusDalgren

Community Member, 288 Posts

8 August 2011 at 11:36pm

If something is going to be included then it needs to be in the Includes directory and the include statement is written without the .ss. So if you put a Layout.ss in the Includes folder then you can include the file with <% include Layout %>. However I'm not sure if <% include %> works inside a control block, you'd have to test that first.

What exactly are you trying to do?

Avatar
quanto

Community Member, 91 Posts

9 August 2011 at 8:51pm

I found the solution in this forumpost. Thanks anyway for your help!