switch themes based on browser?

sinker - July 21, 2006 - 19:26

Hey Folks--

I've got a site that's pretty much ready to launch, except for a couple of nagging CSS positioning problems in Internet Explorer. As much as I'd love to simply install the IE Destroyer module and move everyone to Firefox, that's just not going to happen right away.

Instead, I've re-built the positioning elements of my CSS as a table, and have created a duplicate theme. It's working just fine and looks good in IE. BUT, I really believe in CSS and want to be using it for positioning as well. I am happy to slowly create hacks for what's not working in IE, but want to get my site moving before that. As a result, I'd love to have Drupal dynamically assign themes based on the web browser viewing the site--the tabled theme for IE users, the non-table for everyone else.

Anyone want to help a Microsoft-hater out with some advice and/or code?

Thanks so much,

Dan

Advice

Shmee - July 21, 2006 - 22:53

I just created two CSS' and depending on what browser they are using they use a different CSS. This worked pretty well for me, and I think it's the solution that I am going to have to stick with until there is browser uniformity (yeah right). I hope you can find a more elegant solution.

-Shmee

Would you care to share how

jordan.page - July 23, 2006 - 17:09

Would you care to share how you implemented your alternative CSS?

It shouldn't be too

jantzen - July 21, 2006 - 23:25

It shouldn't be too complicated to write a basic module to detect the user agent string and then select a theme based upon that. I'm not sure how you'd go about doing it, but as far as modules go it ought to be quite simple.

I'm right there with you

sinker - July 22, 2006 - 01:43

I'm not sure how you'd go about doing it, but as far as modules go it ought to be quite simple.

I'm right there with you. In my head, I can draft a perfect module to do exactly that, complete with a settings file that allows simple input for what browsers go where, etc....

But what's in my head, and what I can pull off in reality, are pretty far apart.

Nowadays, almost three years

mauricemengel - May 19, 2009 - 14:21

Nowadays, almost three years later it should work with

http://drupal.org/project/browscap and

http://drupal.org/project/switchtheme

have fun

Conditional Stylesheets module

grobemo - May 19, 2009 - 14:25

Drupaleers trying to cope with cross-browser CSS compatibility problems may also be interested in the Conditional Stylesheet module.

I take it the IE Destroyer module still doesn't exist?

 
 

Drupal is a registered trademark of Dries Buytaert.