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.

Template Questions /

how to implement change themes through GET?


Reply


2 Posts   1273 Views

Avatar
WebSpilka

Community Member, 83 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, 83 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';