Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

Dynamic CSS

Posted 05 Mar 2002 10:50:26
1
has voted
05 Mar 2002 10:50:26 mac mceldon posted:
OK, hello,

I'm a bit new to CSS styling and am trying to create a site for a customer that is customisable (color,background,font wise).

I need to change the CSS styling according to an entry called from my database, my attempts at coding this have failed.

So there you are - I'm looking for resources or help in any way.

Thanks for your time.

MAc

Replies

Replied 05 Mar 2002 11:21:18
05 Mar 2002 11:21:18 Owen Eastwick replied:
Try these guys:

www.projectseven.com/index.htm

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 05 Mar 2002 12:02:44
05 Mar 2002 12:02:44 mac mceldon replied:
Yes, know the site - any other ideas anyone ?


Replied 05 Mar 2002 22:24:20
05 Mar 2002 22:24:20 Dennis van Galen replied:
an idea, here goes in Javascript
say my CSS value pulled from the database looks like this in the codes:

<%=(rsUserPrefs.Fields.Item("CSSname".Value)%>

And your CSS code in your (template) page looks like:

<link rel="stylesheet" href="../kpn_ned.css" type="text/css">

Then it's just a matter of altering the CSS codeline to this:

<link rel="stylesheet" href="../<%=(rsUserPrefs.Fields.Item("CSSname".Value)%>" type="text/css">

Another option would be:

<link rel="stylesheet" href="../<%=(rsUserPrefs.Fields.Item("CSSname".Value)%>.css" type="text/css">

It depends if you want to save a tiny little Dbase space by not adding the .css extension into the database and then this should do what you are looking for.

Note that for this to work it should pull the FILEname from the dbase, for example...

Customising for departments in my case would result in following options, the filenames get stored in the CSSname field:

Option 1: KPN Nederland - Filename: kpn_ned.css
Option 2: KPN Sales - Filename: kpn_sales.css
Option 3: KPN Indonesia - Filename: kpn_indo.css
etc.

Happy developing.
Oh, i forgot to mention that include files and stuff with filenames all can be customized this way, i could use this to let a fellow employee change the look of my site to fit a set value of kpn looks that i bothered to make available to them, it's also used alot to allow sitewide changes by changing one option in for example a handicap menu, visually handicapped would make all buttons, texts etc twice the size.
We gotta cater for everyone, you know.

With kind regards,

Dennis van Galen
Webmaster KPN Nederland
Financial and Information Services

Edited by - djvgalen on 05 Mar 2002 22:34:57

Reply to this topic