Hello,
I am trying to add the theme switcher in this post. http://www.silverstripe.org/customising-the-cms/show/252519 However, I am not sure where root.content.main is located I thought it would be in leftandmain.php but could not find it. any help would be greatly appreciated.
<?php
class Page extends SiteTree {
static $db = array(
'ThemeX' => "Enum('higherground,blackcandy','higherground')"
);
static $has_one = array(
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new DropdownField(
'ThemeX',
'Select A Theme:',
singleton('Page')->dbObject('ThemeX')->enumValues()
));
return $fields;}
}
class Page_Controller extends ContentController {
function init() {
SSViewer::set_theme($this->ThemeX);
parent::init();
Requirements::themedCSS("layout");
Requirements::themedCSS("typography");
Requirements::themedCSS("form");
}
}
?>
Thanks,
Spencer