开发者

Magento - Is it possible to feed IE6 a different template?

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, wh开发者_开发百科at code do you put there?

Cheers


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;
    }


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.


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.


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 :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜