Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » IE browser detection not working
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.
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
- Index
- » MetaMod
- » MetaMod General Support
- » IE browser detection not working
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7630
- Newest User:
- welch84998
- Members Online:
- 0
- Guests Online:
- 104
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked