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.

Themes /

Discuss SilverStripe Themes.

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

User theme changer


Go to End


2 Posts   2193 Views

Avatar
mexik

Community Member, 16 Posts

1 September 2010 at 7:18am

Hello,

I'd like to have a theme changer on my website.

What I want basically is to give users an ability to change my website theme if they want to, so I could get two different type of customers (for example: one could be very simple and the other one could have a lot of things like glamour style).

So ... is it possible to make something like that ?

Avatar
Bambii7

Community Member, 254 Posts

2 September 2010 at 1:05pm

Edited: 02/09/2010 1:06pm

Ahhh theme selectors nooooo :p
I think you could do some thing with a session variable and maybe the _conifg.php in mysite.
You set them theme inside _config, so you'd need some basic forms on Page.php that set a variable. Then maybe in the _config have

$mytemplate = Session::get("mythemevariable");
if($mytemplate) {
SSViewer::set_theme($mytemplate);
} else {
SSViewer::set_theme('defaulttheme');
}

Not 100% if that'll work