tags:

views:

197

answers:

4

Hi All

Just wondering if, in the config/design section of the Magento admin - where you specify templates - if it’s possible to add IE6 as an exception - so it doesn't get the custom template and falls back to using the default one?

If so, what code do you put there?

Cheers

A: 

I think your best bet would be to add a IE 6 conditional comment in the header of your custom template and go from there. However, that'd cause, as always, a lot of headache.

HelpAppreciated
Yeah, I know I can do that, but I also know that you can set templates just to show for iphones, so I reckon you must be able to specify browsers too...
Sam
A: 

Quickest Way (not recommended)

edit this file app/core/Mage/Core/Controller/Front/Action.php and change preDispatch method like this:


public function preDispatch()
    {
        $this->getLayout()->setArea('frontend');

        parent::preDispatch();

        if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')){
            Mage::getDesign()->setArea('frontend')->setTheme('default');
        }
        return $this;
    }

cubny
But will that not apply to all versions of IE then, not just IE6?
Sam
just edit it according to your preference...
Bo Tian
A: 

My recommendation would to develop a separate stylesheet just for IE6 and put in a conditional comment (see http://www.quirksmode.org/css/condcom.html) to feed IE6 said stylesheet. The only way to do as you said and have it fall back to the default is via a PHP hack (as cubny suggested) and this method is unreliable and hackish at best.

Paragone
I'd only recommend this if the IE6-only design is just a tweaked version of the main design. Otherwise, having to download a bunch of irrelevant CSS/images is a waste when this can be handled server-side.
philfreo
How exactly is it irrelevant to have an additonal stylesheet for IE6? I agree it's a waste, but you can hardly blame a web developer for having to still support the browser.
A: 

Try setting it up like the iPhone/iPod theme, but with MSIE 6 as the search string. Some simple testing will tell you if it's working or not :)

philfreo