470,833 Members | 1,397 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

CSS changer - how to implement spanning multiple subpages? (Second try - no response on last post)


I have a (dummy) page that uses PHP to change CSS - so that different
looks can be applied without loading the complete page again etc, and to
ease the deployment of new looks - much like www.csszengarden.com does
(actually part of my script is from their site).

Anyway - currently the PHP-script only covers the first page - if I have
subpages, the different CSS doesn't "follow through" - I'm wondering how
I can make it.

The code I'm using is this (with comments):

<?php

$tempCSS = $HTTP_GET_VARS["cssfile"];
if ($tempCSS != "") {
$loadCSS = $tempCSS;
} else {
/* sets a default CSS file if no querystring specified */
$loadCSS = "default.css";
};
$currentDesign = $loadCSS;


<!-- make sure this goes somewhere between <head> and </head> -->
<link rel="stylesheet" type="text/css" href="<?php echo $loadCSS; ?>"
title="default" media="screen" />

<!-- to link any particular stylesheet later, just add a querystring to
the current page: -->
<a href="thispage.html?cssfile=/002/002.css">Change Style</a>

How can I take the current value from the address bar and add it to any
link that's a local link to subpages?
--
ØNL
http://www.langbakk.no
Jul 17 '05 #1
5 1920
How can I take the current value from the address bar and add it to any
link that's a local link to subpages?


Use cookies.
Jul 17 '05 #2
I denne meldingen:cm**********@titan.btinternet.com,
skrev: 2metre <2m****@xxxhersham.net> følgende:
How can I take the current value from the address bar and add it to
any link that's a local link to subpages?


Use cookies.


Yes, I could probably do that - how would I do this exactly, though?

Since the "change look" menu is present on all pages, it needs then to
set a cookie _every time_ a user changes the look (or am I missing
something here?) - and that could result in a lot of cookies - at least
I think so.

What I was looking for was more like a way to add a value to every link
that's clicked on the page _that isn't a "change look" link_ which would
keep the last clicked "look" when the user changes pages.

As the current CSS-file that's in use is shown in the address bar, it
should be possible, shouldn't it?

--
ØNL
http://www.langbakk.no
Jul 17 '05 #3
Ørjan Langbakk wrote:
Since the "change look" menu is present on all pages, it needs then to
set a cookie _every time_ a user changes the look (or am I missing
something here?) - and that could result in a lot of cookies - at least
I think so.

If your cookie is called (for example) 'cookiepage', every cookie change
request just changes the value of that. Only 1 cookie. Cookie's are
available site-wide.
Jul 17 '05 #4
Ørjan Langbakk wrote:
I have a (dummy) page that uses PHP to change CSS - so that different
looks can be applied without loading the complete page again etc, and
to ease the deployment of new looks - much like www.csszengarden.com
does (actually part of my script is from their site).

Anyway - currently the PHP-script only covers the first page - if I
have subpages, the different CSS doesn't "follow through" - I'm
wondering how I can make it.


http://csschanger.usenetshit.info/

I would recommend using this in conjunction with a cookie if you want to
remember the visitor's selection between visits.
Jul 17 '05 #5
I denne meldingen:yP*******************@news.xtra.co.nz,
skrev: Nik Coughin <nr***********@woosh.co.nz> følgende:
Ørjan Langbakk wrote:
I have a (dummy) page that uses PHP to change CSS - so that different
looks can be applied without loading the complete page again etc, and
to ease the deployment of new looks - much like www.csszengarden.com
does (actually part of my script is from their site).

Anyway - currently the PHP-script only covers the first page - if I
have subpages, the different CSS doesn't "follow through" - I'm
wondering how I can make it.


http://csschanger.usenetshit.info/

I would recommend using this in conjunction with a cookie if you want
to remember the visitor's selection between visits.


Looks promising - I'll look into it as soon as I have time! Thanks!
--
ØNL
http://www.langbakk.no
Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Billy Jacobs | last post: by
3 posts views Thread by Arun | last post: by
10 posts views Thread by Girish | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.