Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Themes in v2.1.0

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

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

Page: 1 2
Go to End
Author Topic: 4122 Views
  • gakenny
    Avatar
    Community Member
    153 Posts

    Themes in v2.1.0 Link to this post

    Hello,

    With the new themes folder offered in v2.1.0, does this now mean that all stylesheets and images associated with the presentation of the website should be now located here rather than under mysite? Does this mean that the css, images, etc. folders under mysite are obsolete? Is there any documentation relating to this change available?

    Thanks,

    Gary

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Themes in v2.1.0 Link to this post

    They are obsolete in a way, I think mysite is used if you want to override a theme? or as a backup if there is no themes.. anyway you should develop your site as a custom theme in the themes folder.

  • gakenny
    Avatar
    Community Member
    153 Posts

    Re: Themes in v2.1.0 Link to this post

    Hi Will,

    Thanks for the reply. It seems that I cannot override the contents of the css, images, templates directories under the themes directory with the contents of mysite. The only folder that appears to work under mysite now is the code folder.

    Cheers,

    Gary

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Themes in v2.1.0 Link to this post

    ah ok. I would just use the themes folder for all your custom css/templates and leave mysite for the code.. Maybe this is getting a tad confusing as its not too obvious as to where you edit css/templates..

  • Karl
    Avatar
    2 Posts

    Re: Themes in v2.1.0 Link to this post

    I've experienced a similar issue. mysite/templates/Page.ss doesn't override themes/blackcandy/templates/Page.ss. The above post indicates that changes should be made in the theme but this doesn't make sense to me conceptually. I should be able to drop in a new theme and it should work (maybe not perfectly, but still work) without edits to the theme. Any edits I make should be in mysite without need to change the theme.

    Additionally, this page, http://doc.silverstripe.com/doku.php?id=themes:developing , indicates that mysite should override the theme but this is not happening. Any suggestions or input?

  • Damo
    Avatar
    5 Posts

    Re: Themes in v2.1.0 Link to this post

    Yar, I am also led astray by 'mysite/templates/Page.ss' not overriding 'themes/blackcandy/templates/Page.ss' as it was described in the aforementioned wiki page. Anyone able to shed light on this? This is just a "me too" but what's the official stance? Overriding with mysite or simply tailoring a theme directly?

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: Themes in v2.1.0 Link to this post

    This is a bit of an open issue. The current thinking is to do the following:

    * Leave CSS and SS files out of the mysite folder.
    * If you want to create your own HTML, and don't want to edit the theme, then duplicate the theme and edit that.
    * If you want to start from scratch, then create your own theme from scratch.

    The theme files take precedence over the files in mysite because the concept was that you'll override the built-in template (in mysite) with one from a theme.

    However, this isn't clearly spelled out in the documentation.

    From a product development perspective, the best bet is probably to remove the .ss and .css files from the mysite folder in the installer, and to improve the documentation about how to create your own custom theme.

    The mysite folder should just contain your PHP and JS code.

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: Themes in v2.1.0 Link to this post

    overriding mysite with blackcandy might be a common scenario when using the installer, but i think usually its the other way around: you have a working theme, and want to customize little bits.

    for example, i just set up a instance where i don't care too much about layout, and used the default blackcandy. i DID care about the "your sitename here" title though. in the use-case described by you, i'd have to duplicate the whole theme dir to make this change (rather than just overriding Page.ss) - and loose easy upgrade-options through svn.

    if its logically possible to give mysite-templates priority if present, i suggest we should give this option to the developer. he can still decide to duplicate the whole theme if the amount of customizations justifies it.

    what do you guys think?

    4122 Views
Page: 1 2
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.