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

Templating hierarchy


Go to End


2 Posts   1625 Views

Avatar
FrozenFire

Community Member, 1 Post

1 May 2012 at 4:41am

Edited: 01/05/2012 4:42am

I'm quite surprised that this hasn't yet been thoroughly addressed, as it's something that I ran into fairly quickly.

My site structure looks something like this:

Site ->

  • Home
  • Company ->
    • Vision
    • Team
    • ...
    • ...

  • Portfolio ->
    • ...
    • ...

And so on. It's a three-level hierarchy. All of the subpages are very simple, and don't need their own controller logic. They're simply template content that wouldn't do well with being in the CMS.

I would like to have these subpage templates in a subdirectory of Layout, and rendered automatically within their parent pagetype template. I cannot figure out how to extend the template selection of SiteTree to do this.

Any ideas?

Avatar
3dgoo

Community Member, 135 Posts

15 May 2012 at 6:02pm

Couldn't you just create the pages in the CMS and add the content in there?
Wouldn't this be simpler than creating a different template for each?