17488 Posts in 4473 Topics by 1978 members
| Go to End | Next > | |
| Author | Topic: | 2041 Views |
-
Previewing themes

28 February 2008 at 10:01am
Is it possible to preview a theme on a live site?
For example by using an URL parameter: (site)?theme=new-theme. I need this because I really think it's to much work getting remote access to my dev server working (running devserver localy in a linux box currently). -
Re: Previewing themes

29 February 2008 at 4:00pm
well demo.silverstripe.com does this with code. You'll notice all our silverstripe.com/themes can be previewed at the demo, right?
if(isset($_GET['theme'])) {
$_SESSION['theme'] = $_GET['theme'];
}$theme = isset($_SESSION['theme']) ? $_SESSION['theme'] : 'blackcandy';
SSViewer::set_theme($theme);
-
Re: Previewing themes

2 March 2008 at 4:09am
if(isset($_GET['theme'])) {
$_SESSION['theme'] = $_GET['theme'];
}$theme = isset($_SESSION['theme']) ? $_SESSION['theme'] : 'blackcandy';
SSViewer::set_theme($theme);
Which file do you add this code in?
-
Re: Previewing themes

2 March 2008 at 8:01am
mysite/_config.php instead of SSViewer::set_theme('blackcandy');
-
Re: Previewing themes

6 March 2008 at 8:12am
Thanks for the reply. Sorry for my absence here, I've been away.
I'm gonna test it soon, but I have some things I need to do first. But I have no doubts that it will work, I even understand how it works:).
-
Re: Previewing themes

6 March 2008 at 10:34am
I've got it working quite good with a family site I am building.
You need to create a hyperlink which links to each of the themes using the code:
?theme=plain
?theme=blackcandy
?theme=terrafirmaetc.
-
Re: Previewing themes

6 March 2008 at 9:54pm
Yes, that would be the way to go if I wanted a multitheme site, but as it is now I only need to preview the themes.
| 2041 Views | ||
| Go to Top | Next > |



