Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.



Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.


IE browser detection not working

IE browser detection not working

Hi Stephen,

The browser detection doesn´t seem to work for a module.

What I´m trying to achieve:
- On ALL browsers EXCEPT IE I want to show a module on a inset position (header slider/image).
- On all IE versions I want to show an alternative, since the module is not showing correctly.

What I´ve done:
- Unpublished the 2 modules, setting them to a non-existing position (MetaMod)
- Published the MetaMod on the position where I want one of the two module to display.
- Put the following recipe (and I´ve tried some others) in the PHP field:

if ( $core_genius->check( "browser_type = ie" ) ) return 664;
else return 757;

- Cleared system and brower cache.

But what happens is that it is showing (randomly?) one of the 2 modules, at all different browsers I´ve tested it on (IE, Chrome, Firefox, Safari).

Any help would be appreciated, since I´m stuck with this problem and cannot find the solution anywhere on the forum.

Beginner Modder
1 Posts
Administrator has disabled public posting

Re: IE browser detection not working

Hi jorgve,

sorry to hear you have having this problem. To help debug it, could you please try the following PHP, then test with different browsers to see how MetaMod identifies them?

echo "Your browser is: " . $core_genius->info("browser_type") . "<br />";

Hopefully you'll get consistent answers for each browser you try.

If you are getting seemingly random answers, my guess is that it might be because of page caching. Are you using the System Cache plugin? If so, each page gets cached by URL not by browser type, so whichever browser causes the cache to be taken will also cause that browser to be "remembered" in the cache. So when a different browser goes to the same page it will see the cached result according to the browser that retrieved the page the 1st time. (hope that's clear...)

To get around that, either turn off the System Cache plugin, or switch to using a cache system like JotCache that gives the ability for the cache to cache differently according to browser type.

Hope that helps,

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

3330 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
Total Topics:
Total Polls:
Total Posts:
Posts this week:
User Info:
Total Users:
Newest User:
Members Online:
Guests Online:

There are no members online

Forum Legend:

 New Sticky