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.

Template Questions /

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

how to implement change themes through GET?


Go to End


2 Posts   2073 Views

Avatar
WebSpilka

Community Member, 89 Posts

30 January 2009 at 1:18pm


what I do to be able to change the theme on the demo site?
I made a few themes and want to make their demo site.
You have to demo site, themes can be changed through GET ?theme=:
http://demo.silverstripe.com/?theme=balance
But when I do so on my site, theme does not change
When I delet from _config.php line
SSViewer::set_theme('exotic');
and put in browser ?theme=exotic
I get
FATAL ERROR: None of these templates can be found: Page.ss, ContentController.ss
At line 74 in V:\home\solomija.net.ua\www\askold\sapphire\core\SSViewer.php

Avatar
WebSpilka

Community Member, 89 Posts

30 January 2009 at 1:25pm

pl's Close this tem l find resolution
http://www.silverstripe.org/archive/show/79233
//theme settings
if(isset($_GET['theme'])) {
$_SESSION['theme'] = $_GET['theme'];
}

$theme = isset($_SESSION['theme']) ? $_SESSION['theme'] : 'yourdefaultthemehere';