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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Silverstripe 3.1 Change theme


Go to End


3 Posts   805 Views

Avatar
Praveen

Community Member, 49 Posts

9 October 2014 at 2:11am

I have copied the template 'NEW' to themes folder. And also added below code to mysite _config.php

//Theme
Config::inst()->update('SSViewer', 'theme', 'NEW');

Still the theme uses the default template 'simple'.

Avatar
martimiz

Forum Moderator, 1391 Posts

9 October 2014 at 3:22am

Edited: 09/10/2014 3:24am

After changing the theme you need to do a ?flush=all for SilverStripe to find and cache the new templates.

The better way is probably by permanently setting the default theme to NEW in mysite/_config/config.yml (followed by ?flush=all):

SSViewer:
      theme: 'NEW'

That way you can leave the theme selector in the CMS settings on default and Config::inst()->update() isn't called for it on every page request, as it is said to slow the site down...

EDIT: hmm, the new forum layout strips the two spaces before theme: 'NEW' in the code block...

Avatar
Praveen

Community Member, 49 Posts

9 October 2014 at 5:34pm

it is changed to new theme now
Thanks,