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.

All other Modules /

Discuss all other Modules here.

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

can you clear this up for silverstripe noob?


2 Posts   1085 Views


Community Member, 3 Posts

29 September 2009 at 3:59pm

Currently i have one template .ss file named '' This is the first basic page template I've made by converting my html.
It's a basic two column page.

I just installed the calendar module and it's running fine but it appears to be based on "" or at least the two columns from "" are still present resulting in three columns when the calendar is viewed.

I'd like to disregard '' when viewing the calendar page. Is this possible? I was under the impression that the .ss files were templates for pages and assigned to actual pages in the cms. Seems to me that the calendar is somehow being forced into the '' template...

probably missing something obvious here.. but no clue at this point!


Forum Moderator, 4092 Posts

29 September 2009 at 5:22pm

Each template is composed of at least two parts -- the main template, and the layout.

In the root of your templates/ directory, you'll have a This is the main "wrapper" for your site, that is, all the elements that essentially never change from page to page. On this site, the probably ends after the grey strip under the main nav, for instance.

In the Layout/ subfolder, you can define custom templates for each of the page types. A Calendar page will use, for instance.

However, these templates all use inheritance and overrides to make the design fully customizable for you. For instance, if your calendar page requires its own wrapper for some reason -- maybe it looks totally different than the rest of the site -- you can create in the root templates/ directory and include the doctype, main nav, etc as part of that template.

The template parser (SSViewer) will also "fall back" on the most logical choice for a template if one is not found. If you have a Calendar page type and no Layout/ exists, it will fall back on Layout/ because the Calendar object is a subclass of Page.

Further, if you have a module installed, e.g. EventCalendar, SSViewer will always look in your theme directory first for the template, and then fallback on the module. To create a custom template for EventCalendar, for instance, you would copy the file /event_calendar/templates/Layout/ to /your_theme_dir/templates/Layout and make the changes you want. That way, you can safely upgrade the module when new releases come out and have the peace of mind that you have insulated all of your customizations.