[TYPO3-english] Browser Detection Code

bernd wilke x00nsji02 at sneakemail.com
Sat Nov 14 00:40:23 CET 2009


Am Fri, 13 Nov 2009 22:48:34 +0100 schrieb Philipp Gampe:

> Am 13.11.2009, 22:38 Uhr, schrieb Chris Jensen <cjensen at mn-s.ca>:
> 
>> Hello Members of the Typo3 Development Community,
>>
>> I've recently been asked to help a local organization administer their
>> Typo3
>> site, which is proving to be an interesting challenge. I'm slowly
>> working through the available books and tutorials, but I've come up
>> against a challenge that I haven't found a good answer for: namely,
>> what is the best
>> practice for doing browser detection in Typo3? My site is having some
>> display issues in IE 6 (and earlier), so I'm wondering how best to
>> display
>> the site differently on different browsers. This would be easy enough
>> to do
>> through straight PHP code, but I want to make sure that there isn't a
>> better
>> way to do this within the Typo3 system.
>>
>> Thanks,
>> -Chris
> 
> you can use conditions in TS

or just browser-conditions (conditional comments) to include special CSS-
files for every(?) IE-version:

--8X----8X----8X----8X----8X--
page.headerData {
	10 = HTML
	10.value (
<!--[if IE 8]>
    <link rel="stylesheet" type="text/css" href="fileadmin/ie8.css" />
<![endif]-->
<!--[if IE 7]>
    <link rel="stylesheet" type="text/css" href="fileadmin/ie7.css" />
<![endif]-->
<!--[if IE 6]>
    <link rel="stylesheet" type="text/css" href="fileadmin/ie6.css" />
<![endif]-->
)
}
--8X----8X----8X----8X----8X--
advantage to TS-conditions: just one version to be cached

bernd
-- 
http://www.pi-phi.de/cheatsheet.html


More information about the TYPO3-english mailing list