Guys
I have introduced a page level template choice which uses SSViewer::set_theme() as the means to set the theme on a per page basis. This appears to work perfectly and have little or no overhead. I still pull the javascript and anything else I can from the root config theme to make caching better.
Now I discover SSViewer::set_theme() is deprecated for yml config settings. I cant do a config inst() change like this or it will be global. whats the workaround - or alternatively PLEASE KEEP the method.
UPDATE: I see that it is already using Config::inst()->update('SSViewer', 'theme', $theme) in that method. This does not seem good.
This is what I am doing with my own static $db Page variable "Theme" in my Page.php Page_Controller init method
switch ($this->Theme){
case "Business":
SSViewer::set_theme('business');
break;
case "Consumer":
SSViewer::set_theme('consumer');
break;
default:
SSViewer::set_theme('normal');
}
Im guessing now that this is BAD!! Or is it? It does work. I can flit between different pages and they render and cache perfectly.
Julian