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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Template Questions /

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

Template overriding question

Go to End

4 Posts   2691 Views


Community Member, 14 Posts

12 January 2012 at 3:37am

Hi all,

my company is developing a module that will be shipped with a default theme. For our clients we want to provide also a little set of other themes, but also we want to allow any client to customize its installation (without modify the theme).

So I'm trying to use the override capabilities of the template system as stated in the doc:
but I've noticed that mysite/ (or any folder set in the $project) doesn't override anything existing in the theme. I've found this ticket and tried the patch on the SSViewer.php. Anyhow now I'm able only to override Layout templates but not /Includes or /css.

In the core dev group ( seems that with SS3 the template order inclusion will be rewritten, but for now there's any suggestion to let mysite/ override theme/ files (.css or .ss)?

It seems to me that for every SS installation (with 2.x) I'll must edit in some way the theme I use. I'm right or maybe I've done something wrong?


Community Member, 14 Posts

12 January 2012 at 5:56am

I try to better explain my situation.

This is the priority of the files as far as I can see with some test:
1 - themes/xxxtheme/css/style.css
2 - module/css/style.css
3 - mysite/css/style.css

Has anyone ever override /themes files (css or templates) with other files in /mysite folder?

Thanks for the help ;)


Forum Moderator, 5523 Posts

14 January 2012 at 4:29pm

At the moment themes override mysite. Like you found, there is discussion to change this but for now, you need to edit the theme or store you overrided templates in a subtheme like themes/xxxtheme_custom/.. which should? override themes/xxxtheme.


Community Member, 14 Posts

18 January 2012 at 12:06am

Edited: 18/01/2012 12:32am

Thank's for the reply. I posted a comment also in the doc ( hope that helps to avoid misunderstanding.

Anyhow this seems to me quite a big issue for Silverstripe and Theme/Module development, hope that release 3 will fix it.

UPDATE (little later) - yes, the subtheme can override a module, but you must call the subtheme like the theme plus _ (underscore) and the module's name (eg. theme/theme_module/). So is not really useful for my issue ;)