In Smarty, how do I check what browser is being used?

by Stephan Borg
Friday, July 01, 2005
Posted to Developer's FAQ
Here is a code sample for your .tpl:

{if $gBitLoc.browser.client eq 'mz' or $gBitLoc.browser.client eq 'ie'}
This browser is IE or Mozilla based!

the end.


Browser name & version

by Vince Mercer, 17 Nov 2009 (21:33 UTC)
...How about the browser version?

by Vince Mercer, 18 Nov 2009 (00:09 UTC)
Actually, the proper code is:

{if $gBrowserInfo.browser eq 'mz'}
You are using Firefox