Internet exploder

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Martin
Regular
Posts: 90
Joined: Mon Sep 27, 2004 1:30 am
Location: Oslo
Contact:

Internet exploder

Post by Martin »

So, I guess we all know by now that Internet Exploder is a monster that should have been put down at birth. Until now I've decided to let the freakishly bad browser alone, and not bothered designing for it. Recently however I've had a lot more visitors using IE on my blog, so I guess it's time I thrw them a bone.

What would be the easiest way of redirecting users of IE to a different CSS file than the other browsers. I know how to redirect these people to anther URL, but I really don't want to have to maintain two installations of s9y, so if I could somehow specify the template used whenever someone accesses the site with IE, that would be the best solution.

-m
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Internet exploder

Post by garvinhicking »

Well, the usual solution to this is to use CSS Hacks that the Internet Explorer parses and others choke on. This is the common solution. :-)

A second solution is to use a JavaScript within your HEAD-part (either edit index.tpl or use the HEAD Nugget plugin) and let that javascript import a Stylesheet for the internet explorer only (parse the navigator object)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Martin
Regular
Posts: 90
Joined: Mon Sep 27, 2004 1:30 am
Location: Oslo
Contact:

Post by Martin »

Okay.
I've been checking up on this, and decided that I definitly do not want to use Hacks. Javascript doesn't seem to be the best solution either as it can play merry hell with some browsers and also wil delay the page load.

I found a neat script here that I'd love to integrate, but my attempts so far has been futile.

Basically (if you don't want to click the link) the script asks to include a php-sniffer script to determine the browser and then load the CSS accordingly. What happens when I try to include the script is that no CSS shows up whatsoever.

Do anyone have a solution to this?

-m
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

I really recommend you to use CSS hacks. Even if it sounds dirty, it isn't.

Basically it is really no problem to create CSS stylesheets that work with both browsers. Including a browser sniffer creates two problems: First you need to hook them into your script, and second they tremendously increase the maintenance overhead.

If you're really going to want to do this, you will need to play with our Plugin API and use the 'css' hook to modify your data according to the used browser.

Bear in mind that some browsers do not submit a proper HTTP useragent string, or they may fake it at will, or they are using a proxy which does not support it. Using CSS hacks however will always properly render on the effective client used.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply