• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Force Style for Specific Route Prefix

#1
I'm working on setting up a developer's area on our forums. I'd like for anything that matches the route prefix I created to use a specific theme that is different from the site's default theme. I don't want to allow users to have any choice in select thing style. Any suggestions on how to do this?
 

Chris D

XenForo developer
Staff member
#2
You would do this from the Controller that is used by the Route rather than the Route directly.

Just add this to the preDispatch in your controller:
PHP:
$this->setViewStateChange('styleId', 9999);
Replace 9999 with the correct style ID.

You can, of course, surround that with other conditions, e.g. user group.
 
#3
You would do this from the Controller that is used by the Route rather than the Route directly.

Just add this to the preDispatch in your controller:
PHP:
$this->setViewStateChange('styleId', 9999);
Replace 9999 with the correct style ID.

You can, of course, surround that with other conditions, e.g. user group.
That is exactly what I needed. Thanks!