WebsiteBaker Support (2.8.x) > Templates, Menus & Design
Change color template different css
Re-Mi:
Hello All,
I'm making a website, and i want some pages to be different color. To get this working i created a template styled pure on css, and separated the colors in a different css file.
Like this
--- Code: ---index.php
css/template.css
css/color.css
--- End code ---
I know i could upload the same template with different colors in the css. But is there a way i could make it work with 1 template and different color css files.
Like this
--- Code: ---index.php
css/template.css
css/blue.css
css/green.css
css/red.css
--- End code ---
The first thing that came in mind was a droplet that would call the right css file added to each page. But i can't seem to find the code for that. Do you guys of girls know an other or better way to accomplish the thing i want ? Or know the code i have to apply ?
Greetz,
Michel
Tez Oner:
Maybe linking/importing a css file from a WYSIWYG or Code module section could do the job:
Just paste <style url="etc......"> in the 'code-view" of WYSISWYG, then the style sheet is loaded only for that particular page
Cheerz,
Tez
Ruud:
3 different approaches to play
--- Code: ---<?php
$css = "red.css"; //default
if (PAGE_ID==1} $css = "blue.css";
if (PAGE_ID==2} $css = "yellow.css";
if (PAGE_ID==382} $css = "brown.css";
echo TEMPLATE_DIR.$css;
?>
--- End code ---
or
--- Code: ---<?php
// generates stylesheet names like home.css / about_us.css
$css = MENU_TITLE.".css";
echo TEMPLATE_DIR.$css;
?>
--- End code ---
or just one stylesheet with a unique selector for each page.
You will get extra selectors like
.page-12 { color: #f00; }
--- Code: ---<body>
<div class="page-<?php echo PAGE_ID; ?>">
......
</div>
</body>
--- End code ---
Re-Mi:
Thank you both,
I will experiment the options until i find the best method for me.
Greetz,
Michel
Vincent:
Could we also modify Ruuds first approach in a way that all children of let's say PAGE_ID=5 inherit the same stylesheet as PAGE_ID=5, being a different one than the default style sheet?
Would be nice! And handy!
Vincent
Navigation
[0] Message Index
[#] Next page
Go to full version