Jump to:

1369 Posts in 487 Topics by 520 members

Themes

SilverStripe Forums » Themes » Subtemplates: possible to have more than one subtemplate region in a page template?

Discuss SilverStripe Themes.

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

Page: 1
Go to End
Author Topic: 1163 Views
  • dfondente
    Avatar
    Community Member
    15 Posts

    Subtemplates: possible to have more than one subtemplate region in a page template? Link to this post

    I'm new to SilverStripe and have gone through the tutorials and much of the documentation. I'm trying to create a new theme, and am unsure how the subtemplates work. I would like to have more than one subtemplate block in my main Page.ss file (themes/mytheme/templates/Page.ss). From the tutorial, I understand that the $Layout tag will cause SS to use the relevant subtemplate in themes/mytheme/templates/Layout/ that corresponds to the current page type. But what do I do if I have multiple areas on the page that could use a subtemplate? For instance, I have a banner area that should have different content depending on the page type. I tried creating a new folder themes/mytheme/templates/Banner/ with the hopes that putting a subtemplate there would allow me to use a $Banner tag in themes/mytheme/templates/Page.ss to display this subtemplate. But that didn't work.

    Is there a way to add an additional subtemplate region like this? Or is $Layout the only subtemplate tag available?

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Subtemplates: possible to have more than one subtemplate region in a page template? Link to this post

    $Layout is currently the only subtemplate tag you can use.

    1163 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.