Jump to:

1382 Posts in 491 Topics by 521 members

Themes

SilverStripe Forums » Themes » Location of frontend files

Discuss SilverStripe Themes.

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

Page: 1
Go to End
Author Topic: 679 Views
  • Silverfish
    Avatar
    Community Member
    59 Posts

    Location of frontend files Link to this post

    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

  • Plato
    Avatar
    Community Member
    26 Posts

    Re: Location of frontend files Link to this post

    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.

  • Silverfish
    Avatar
    Community Member
    59 Posts

    Re: Location of frontend files Link to this post

    Hi Plato,

    the integration of frontend upgrades is definitely a point!

    Didn't consider this before, thx for your input

    Regards
    SF

    679 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.