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.

Customising the CMS /

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

allow user to customize page theme


Go to End


21 Posts   7061 Views

Avatar
mccarville

Community Member, 32 Posts

24 January 2009 at 5:10am

Edited: 24/01/2009 5:12am

I was just working with the code above and I found a little bit of a glitch... It seems the CMS does not like it when $ThemeX does not exist... meaning you would have to build the dropdown, log into the CMS, choose a theme and publish each page that exsists on your site, so that $ThemeX will have a value, before implementing the code in the page controller... otherwise it will return an error (The Red Box 'o Death)

So I came up with a real easy fix to this problem, a quick update to the code in the page controller...

.....

if($this->ThemeX){
  SSViewer:set_Theme($this->ThemeX)
}

....

With the added if statement our pages will use the default theme set in our _config.php file if no value has been passed to ThemeX

Enjoy!... Hope to add a tutorial to recipes soon...

Avatar
MikeOne

Community Member, 40 Posts

28 October 2009 at 5:23am

I know this is a fairly old thread but this is exactly what I was looking for and just wanted to warn others wanting to implement this..

Please note - the last remark made has 2 typos:

if($this->ThemeX){
SSViewer:set_Theme($this->ThemeX)
}

Should be:

if($this->ThemeX){
SSViewer::set_theme($this->ThemeX)
}

(so should be :: and 'set_theme' lower case).

Avatar
MikeOne

Community Member, 40 Posts

28 October 2009 at 5:34am

And another quickie - how would I go about having the switcher in the CMS be the same for all pages?

What I basically need is that ALL pages (of page type Page) have the same theme. I have no problem if the switcher is available on all pages - as long as it takes on the value set in the DB - and if changed and you would go to edit another page - it would have set there as well.

In short - I will need this to behave as a 'global' theme switcher in the CMS. Any ideas how to do this?

Thanks,
Mike.

Avatar
Marlie511

Community Member, 36 Posts

3 November 2009 at 11:56am

2 Questions:

1. I got this working on my main site where I could switch themes from page to page. I have the Subsites up and running and I cannot get it to work on these pages. Does anybody know what I need to do under the subsites to get it working? I want the users of subsites to be able to select their theme so I would not have to manage this.

2. On my main site when I publish it after selecting the theme from the drop menu, the publishing button keeps processing even though it made the change. It is stuck, even though it worked. A little deceptive. Does anybody know how I can fix this?

Avatar
Ematty

Community Member, 2 Posts

12 October 2010 at 6:07pm

By contrast, LARPs tend to be rooted in a single location. It's just part of the method(to Buy WOW Gold). Thirty or more characters come together to interact, plot and do whatever those characters do. Again, if the player base is much smaller, you're really running a series of tabletops. While I'm not saying it's impossible to have (WOW Gold)adventure in LARP, that genre of story just isn't built into the format. As such, I question whether a WOW(RuneScape Gold) LARP would have the same feel as the tabletop or video games. It would take a skilled game master to make the LARP feel adventurous.

Go to Top