Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Hide 3 from IE
Hide 3 from IE
Re: Hide 3 from IE
Sure, no problem.
Check the recipe on the following page, and make sure you do the basic setup right, following the instructions on the Quick Start page:
http://www.metamodpro.com/support/recip … -detection
Hope that helps,
Stephen
Re: Hide 3 from IE
Hi Eliyahna,
"hiding" is just the same as "not showing"... so here's the approach:
- Make sure the module does not show up without MetaMod including it. You do this by editing the target module and setting the Menu Assignment to "none", or to a module position that does not exist on the page (e.g. "metamod" since you probably don't have a module position by that name).
- Set up a MetaMod to display in the place where you wanted your other module to be displayed.
- In the MetaMod, use a rule like the following:
Code:
$UA = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
$IE = strstr($UA, 'MSIE') ? true : false;
if (! $IE) return 101; /* replace 101 with module id of the module to include */
What this does is to only include the module if the user is NOT using Internet Explorer.
If all 3 of the modules are in the same module position, you can just adjust the last line of the rule to include them all at the same time:
if (! $IE) return "101, 102, 103";
And that's all there is to it.
For experts, using MetaMod Pro, there's an alternative way to approach this, that actually hides the modules from the page even if they are published outside of the MetaMod module.
- Get MetaMod Pro and install it as per the instructions, not forgetting to "enable" it after installation.
- Use your target modules completely normally. Don't set them to "Menu Assignment: none" like in the instructions above - just set them up completely normally.
- Publish a MetaMod to ALL pages, into any module position. This MetaMod is not going to contain any modules; it's just a container to put some code into.
- Use the following rule in the MetaMod:
Code:
$UA = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
$IE = strstr($UA, 'MSIE') ? true : false;
if (! $IE) {
$changes->mod(101)->disable();
$changes->mod(102)->disable();
$changes->mod(103)->disable();
}
This will ensure that when a user is using Internet Explorer, modules 101, 102 and 103 will be completely removed from any page where they would otherwise appear.
This frees you from having to "wrap" each of these modules inside a MetaMod whenever you want to use it. It provides a sort of bird's eye view of the system, and an ability to enable/disable different modules depending on whatever kind of parameters you want.
It's incredibly flexible, relatively simple to set up, and extremely useful.
(you can also use this system to dynamically control module parameters - see http://www.metamodpro.com/support/contr … parameters for full details)
Hope this helps,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » Hide 3 from IE
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5943
- Posts this week:
- 2
- User Info:
- Total Users:
- 7642
- Newest User:
- mary26
- Members Online:
- 0
- Guests Online:
- 154
- 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