Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Random templating

by BigLug (Chaplain)
on Oct 08, 2004 at 05:40 UTC ( [id://397554]=note: print w/replies, xml ) Need Help??


in reply to Random templating

Sulfuric:

This is a bad idea™. You will disorient your visitors to the point where they won't be sure where they are. Consisancy is the most important thing in branding. Imagine if every MacDonalds had a random color/font for their 'M' .. you'd not be sure if it was McDonalds or not.

The only exeption I make to that rule is for websites-as-art which, as you've had other people create the look, is not what your site is. Art sites can change as often as they please because the site itself is a piece of art.

All that being said, here's the answer you're looking for:

If your site is CGI based then it's as simple as storing a cookie for however long you want them to get the same template. Read the cookie on each page load and return templates based on the cookie.

If your site is file based, then you want to store your two sites in directories like www.yoursite.com/site1/page.htm and www.yoursite.com/site2/page.htm. Then in apache (which I'll assume you're using) you need to do a mod_rewrite. It's not a two second job and its really not a perl question so I'll leave it at that. Take a look at the apache documentation for mod_rewrite for more information. You'll basically be rewriting www.yoursite.com/page.htm with one of the above links based on a cookie. (Remembering to have some fall back for non-cookie people ... like mod the day of the week).

Just remember that if your site is file based, you'll have to update files in both directories every time you make a change.

Once again though, let me reiterate that this is a bad idea™ and that your users will become confused. I once saw a site with multiple designs but I had to choose to change from the default so at least I knew I was at the same site I'd been at last time.


Cheers!
Rick
If this is a root node: Before responding, please ensure your clue bit is set.
If this is a reply: This is a discussion group, not a helpdesk ... If the discussion happens to answer a question you've asked, that's incidental.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://397554]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-16 18:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found