|
|
Applying Css Through Links. - Different CSS through different links? | ||
Discussion by infamousflame with 10 Replies.
Last Update: July 17, 2005, 5:52 am | |||
This requires that there are three large directories on the server, blue, pink and orange. Each one contains a coloured copy of the website. The things in each directory are: HTML pages, a css giving it it's colour and flash buttons that were coloured the three different colours when they were made.
As you can imagine, this is a nightmare to update, as it requires that each page is copied to three different directories.
I was wondering if applying one of three different CSSs to the site depending on which colour scheme the user wanted to see. I thought this may be accomplished using links to apply the CSS but I don't know if that's possible.
Thanks in advance for any replies,
Infamous.
Sat Jul 9, 2005 Reply New Discussion
It is extremely easy to do it in PHP, i have made one myself for use a long time ago. If you would like it i will give it to you, just send me a message or reply here.
Sat Jul 9, 2005 Reply New Discussion
Sat Jul 9, 2005 Reply New Discussion
Sat Jul 9, 2005 Reply New Discussion
How it works, let me explain
Site
index.php - choose a colour
orange/blue/pink - goes to directory
then in directory is folder named images and a css file, for colouring it
Now, for each folder, the images folder has the images for that colour, and a CSS file to colour the page, so when you switch colour at the very first page, you goto the same site, but in a different colour.
Either that, or we do start using a proper templating system LIKE I suggested so many months ago. We arent coding silly bits of javascript, thats just gonna cause trouble.
Stop wasting time, you seem to have been speaking to Adam, he loves the idea of over doing things, lets not remember he is the boy, who argued, flash should replace all web code.
Sun Jul 10, 2005 Reply New Discussion
QUOTE (Trekkie101)
Stop wasting time, you seem to have been speaking to Adam, he loves the idea of over doing things, lets not remember he is the boy, who argued, flash should replace all web code.I'm not wasting time and haven't been speaking to Adam, well, I have but not before I started posting this and this was not his question.
That defeats the whole point of my question the way you suggested though. The point is I am trying to reduce our workload, and connec came up with an idea that he can do it just through CSS and HTML, which i know are the same things, but you know what I mean.
Sun Jul 10, 2005 Reply New Discussion
Sun Jul 10, 2005 Reply New Discussion
Sun Jul 10, 2005 Reply New Discussion
Sun Jul 10, 2005 Reply New Discussion
Sun Jul 10, 2005 Reply New Discussion
Unless you absolutely need to change the style on the fly, ie. on client-side, don't use javascript!
I'd suggest doing a template system. It is really lot easier than you might think. You just need a way to save the preference of the user (if you let the visitors to select the style), that could be either cookie or a session. Then HTML templates, with the content (and possibly menus and such) replaced with keywords. You should be able to use your current files, with just removing the content and replacing it with something like [CONTENT]. Then have PHP change the keyword into the content, that you have stored only once, with function like strtr() (string translate). You could naturally also use CGI or ASP or whatever you feel most comfortable with.
I'd say that's just as easy if not easier to do than the kind of javascript stuff. The difference is that this will work on everyone's browser without requiring any specific browser settings.
Sun Jul 17, 2005 Reply New Discussion
My New Template I Made (26)
|
(7) Creating Expanding Menu Tree In A Web Page sharing my knowledge
|
Index




