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

Theme Change Problem


Reply


19 Posts   4269 Views

Avatar
Sunnybex

Community Member, 39 Posts

19 July 2010 at 9:16pm

Edited: 19/07/2010 11:47pm

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

Avatar
jb19012

Community Member, 1 Post

20 July 2010 at 2:08pm

Edited: 21/07/2010 1:37pm

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?

Avatar
Shauna G

Community Member, 52 Posts

21 July 2010 at 11:33am

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".

Avatar
SDH

Community Member, 10 Posts

21 July 2010 at 12:09pm

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...

Avatar
Shauna G

Community Member, 52 Posts

21 July 2010 at 12:14pm

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.

Avatar
TotalNet

Community Member, 181 Posts

21 July 2010 at 1:15pm

Edited: 21/07/2010 1:16pm

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 [url=http://doc.silverstripe.org/themes:developing]Developing Themes[/url] 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.

Avatar
Sunnybex

Community Member, 39 Posts

21 July 2010 at 11:22pm

Edited: 21/07/2010 11:22pm

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

Avatar
SDH

Community Member, 10 Posts

22 July 2010 at 4:42am

"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.