Jump to:

1347 Posts in 439 Topics by 514 members

Themes

SilverStripe Forums » Themes » Theme Change Problem

Discuss SilverStripe Themes.

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

Page: 1 2 3
Go to End
Author Topic: 3816 Views
  • Sunnybex
    Avatar
    Community Member
    39 Posts

    Re: Theme Change Problem Link to this post

    Hi Willr,

    after downloading 2.4 for a new project I also got this not-changing-theme-issue. I tried various themes, flushed and everything again and again... and still got no alternartive theme but blackcandy. Even the exchange of the whole content of the themes-folder showed no results.
    Is the content stored somewhere else as well?

    Any new ideas?

    br
    Rebekka

  • jb19012
    Avatar
    Community Member
    1 Post

    Re: Theme Change Problem Link to this post

    Same problem here. I can modify the blackcandy theme by hand and see the changes, but I cannot duplicate the blackcandy folder under a new name, select it in the CMS, and use it. When I try this, all I get is a page without any layout applied. (Yes, I'm flushing, too.)

    I can, however, select and use the tutorial theme from the CMS. Very strange.

    Thoughts?

  • Shauna G
    Avatar
    Community Member
    52 Posts

    Re: Theme Change Problem Link to this post

    SDH - In 2.4, you no longer need to edit the _config.php file to change the theme.

    The selector in the CMS simply edits the _config.php file for you. What it does is pull all the themes from the themes folder. If you don't want a theme listed, you need to delete its folder from 'themes".

  • SDH
    Avatar
    Community Member
    10 Posts

    Re: Theme Change Problem Link to this post

    Thanks, Shauna. I found in another thread that the SSViewer::set_theme() is rumored to set the default theme, but I haven't tested this. A little accurate documentation would go a very long way...

  • Shauna G
    Avatar
    Community Member
    52 Posts

    Re: Theme Change Problem Link to this post

    2.4 was released not too long ago, and it introduced several pretty significant changes. That said, you can still change the theme using SSViewer::SetTheme(), but you don't have to.

    Can you link to the documentation that you're referring to? The documentation is maintained by volunteers, so if you find something you believe to be inaccurate, by all means make it known and someone can verify and fix it.

  • TotalNet
    Avatar
    Community Member
    181 Posts

    Re: Theme Change Problem Link to this post

    Hey

    Just to clarify a couple of points here, to avoid confusion. SSViewer::set_theme() has been used to set the theme (in _config.php) for quite some time now (since 2.3.0 at least). It is the "usual" method of setting your theme and is populated by the installer when you first install the CMS. The Developing Themes documentation explains its use.

    As of 2.4.0 there is now an option to dynamically set the theme in the CMS interface, choosing a theme in Site Config does not actually edit the _config.php file, the setting in this file (i.e. SSViewer::set_theme) serves as the default theme and the Site Config setting will override this default once it is set. Content_Controller uses this setting if available, otherwise serves the default theme.

    I guess with the introduction of this new feature in 2.4.0 the concept of a "default theme" is quite new and so the documentation does not make this point very clear. Personally, unless there is a use case for CMS users needing to dynamically change the theme I would use SSViewer::set_theme() as the primary mechanism for setting a site's theme.

    So, if you're not seeing a change in theme once you've changed _config.php (and used ?flush=all) it's worth checking that the theme has not been overridden in SiteConfig.

  • Sunnybex
    Avatar
    Community Member
    39 Posts

    Re: Theme Change Problem Link to this post

    ok, now I found out where to change it nice and easy... maybe I am too much into codes by now...

    go to the localhost-cms-site (where you edit your text and images and so on)
    find on the left your root directory (the bold with the blue icon)
    -click it-
    then you find a drop down menu with all the themes stored in the themes folder!
    select, save and that´s it

    nice and easy, as I said.
    Thank you Silvertripers for changing this at last!

    Bex

  • SDH
    Avatar
    Community Member
    10 Posts

    Re: Theme Change Problem Link to this post

    "Personally, unless there is a use case for CMS users needing to dynamically change the theme I would use SSViewer::set_theme() as the primary mechanism for setting a site's theme. "

    TotalNet, I found a very handy use last night. I had installed the Maori theme; I like it enough I may use it as a starting point... Anyway, I got around to playing with Event Calendar and the month would not display -- blank space where the calendar should be. I used the selector to switch back to blackcandy, flushed, and magically I have a calendar. Perhaps Maori needs an update for 2.4.0... but at least I know the Event Calendar works.

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