WebsiteBaker Support (2.8.x) > Templates, Menus & Design

Change color template different css

<< < (3/4) > >>

Ruud:
There are some typo's in the examples above  :oops:


--- Code: ---<?php 
$css = "/style.css"; //default
if (PAGE_ID==21) $css = "/dark.css";
echo TEMPLATE_DIR.$css;
?>
--- End code ---
Note the } that should be )   (causing the blank screen)
Also the $css variable with the filename to use should start with a /

sky writer:
Sorry to be a bother, but this just prints:

--- Code: ---http://www.website.com/templates/background/dark.css
--- End code ---
at the top of the web page.  It doesn't use the dark.css

Tez Oner:
Eeey,

it's not that sophisticated as all the php-code above... but why not adding for example:

<link rel="stylesheet" type="text/css" href="/wb/templates/css/dark.css" media="screen,projection" />

in the WYSIWYG module of a page (paste in code-view....) and on the other child-pages duplicate the (dark-css)
module-section with the section-picker module... do the same with the other css (color) files...
so another WYSIWYG-section on a other page etc etc... this work... no matter what code... and takes
maybe 15 minutes (without a cup of coffee...) ;)


or check out my Template Framework 3 Lite (demosite.vanallerle i.com) (it uses another technique) with handeling Css files and Vars,

Cheerz,

Tez

sky writer:
Hi Tez,

Thank you for the alternate solution, but I like the idea of just a few lines of code in one location, as opposed to multiple sections on various pages.  The main reason is that this will all be temporary.  My client just wants to see a bunch of pages with different themes, so she can click through them and compare side to side.  Then she will pick one overall theme for her website.

Your Framework looks impressive, but is more than I need for this already established website.

Cheers!

Ruud:
Tez is a little bit right.
Now you have the url of your template.
You will need to put that in a <link> to be seen as command for the browser to load the stylesheet.

something like
<link rel="stylesheet" type="text/css" href="<?php ..... ?>" />

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version