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.

Themes /

Discuss SilverStripe Themes.

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

Location of frontend files


Reply


3 Posts   704 Views

Avatar
Silverfish

Community Member, 59 Posts

7 December 2011 at 11:45pm

Hi There,

as far as I see now, SilverStripe modules bring all their templates, images and css files together with the backend code in the project folder. For me this seems to make sense as well for a website project (i.e. mysite) since I can move a whole project easily from one to another SilverStripe system by just moving one folder.
No the documentation says: "A theme is a set of HTML/CSS/Javascript and images that can be used to provide a skin for a site. A theme does not include any PHP: instead it should be separate from the code which allows the portability of a design. After all, this is an MVC framework!" (http://doc.silverstripe.org/sapphire/en/topics/theme-development).

Sure we want to separate code and layout. But do we really have to separate their folders?

Anyone in for this sure a bit philosophical discussion? :)

Regards
SF

Avatar
Plato

Community Member, 26 Posts

24 January 2012 at 10:53am

Edited: 24/01/2012 10:54am

Themes are separate from the project directory, but the project takes precedence. If you put a template file into your project dir it will be used over whatever is in the theme dir, who's files get used in preference over any template files provided by the module.

Separating out the theme files allows one site to easily switch themes, where as if they're all in the same project dir, they simply get used.
This would allow a site to have special themes, for example a Christmas theme for their November/December sales period, and easily turn it on and off without having to fiddle around with the file system.

Getting too hung up on the separation of M, V and C gets one into all sorts of pointless debates with no real answer.

Short answer: you'd don't NEED to use the themes dir, but it makes things a little easier when upgrading front end only changes, etc.

Avatar
Silverfish

Community Member, 59 Posts

26 January 2012 at 5:37am

Hi Plato,

the integration of frontend upgrades is definitely a point!

Didn't consider this before, thx for your input :)

Regards
SF