I have made for my site additional theme for cecutients. Can I dynamicaly change site theme pushing some button on the main page?
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.
That's really a great solution Alex_SM... your answer solves my problem. Thank you very much for sharing a helpful link.
You are welcome! One notice. In the case when you have several themes add some code :
class Page_Controller extends ContentController
{
private static $allowed_actions = ['changeTheme'];
public function init(){
parent::init();
if ($theme = Session::get('theme')) {
Config::inst()->update('SSViewer', 'theme', $theme);
} else {Config::inst()->update('SSViewer', 'theme', 'your_default_theme');}
}
.............