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.


Our old forums are still available as a read-only archive.

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

include SS files in Layout SS files?


7 Posts   1675 Views


9 June 2008 at 3:28pm Community Member, 63 Posts

Quick question:

Should you be able to include and render an ss file from the theme /include directory from within an ss file located in the them /layout directory? Or can you only do this from within an ss file in the theme root?
1. /Layout/ has <% include TourGallery %> in the code
2. I have a file with HTML in it in /Includes/
I can't get it to render.
I think that maybe I need to have in the root beside and


9 June 2008 at 6:16pm Forum Moderator, 5511 Posts

No you should have all your includes in the includes folder and then where ever you need be able to do <% include SuperCoolNewContent %> you can do. From inside a layout template or a root level template.

See the default theme - it includes the sidebar this way.


9 June 2008 at 7:02pm Community Member, 63 Posts

That seems to be what I'm doing though.
The formatting of the linespaces in these forums makes this sort of explaination a bit hard, but here is what I have:

1. for my general pages
2. Layout/ for Tours pages (same as Page apart from a few layouts)
3. Includes/ - Rather long HTML code for a image gallery

In Layout/, I have <% include TourGallery %> in a certain place. It does not render, but the way I understand your post it should??


9 June 2008 at 7:30pm Forum Moderator, 5511 Posts

Yep that looks pretty right to me. Make sure its not something stupid like different filenames, make sure you flush etc etc


9 June 2008 at 9:52pm Community Member, 63 Posts

Thanks Will,

I found the problem to be an unclosed control in /Includes/ There was no error thrown like if you do the same in a Layout or Root template. It just didn't appear.

All good now. Cheers for the confirmation.


9 June 2008 at 9:57pm Forum Moderator, 5511 Posts

Good to hear, Im surprised it didnt throw any error. The parser is meant to be pretty strict on that sort of thing and throw a error. I might see if it happens for me, might be a issue with includes.


9 June 2008 at 9:58pm Community Member, 63 Posts

I can try to replicate and post code if it helps