Hello
I am putting together a site with 3 different sections, ie. Sales & Marketing, Branding & Default. Each section needs the same layout, but different colors in the submenu and headings.
I found this post and put the following code into Controller.php:
function init(){
$cssFile = 'default.css';
switch($this->URLSegment){
case 'test': $cssFile = '1.css'; break;
case 'contact': $cssFile = '2.css'; break;
// etc.
}
Requirements::css($cssFile);
}
However, back on the site if I create a new page "test" (url=test, title=test, navigation=test) the 1.css file is definitely not called. What am I doing wrong?
Also, is it possible to use wildcards so that any page with "test" in its title/url, ie. "test-page1" or "test-ing" will call the 1.css file?
Many thanks in advance.