Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

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

 

Hide 3 from IE

Hide 3 from IE

I have 3 modules that do not show in IE which results in a big blank space. Can I just hide them from IE users? If so, how?

Eliyahna
Beginner Modder
ranks
useravatar
Offline
3 Posts
User info in posts
Administrator has disabled public posting

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

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

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: Hide 3 from IE

Thanks for your reply. I had already found that but it says how to show something different... not how to completely hide a module if it's IE. Is there a way to just hide it?

Eliyahna
Beginner Modder
ranks
useravatar
Offline
3 Posts
User info in posts
Administrator has disabled public posting

Re: Hide 3 from IE

Hi Eliyahna,

"hiding" is just the same as "not showing"... so here's the approach:

  1. 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).
  2. Set up a MetaMod to display in the place where you wanted your other module to be displayed.
  3. 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.

  1. Get MetaMod Pro and install it as per the instructions, not forgetting to "enable" it after installation.
  2. 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.
  3. 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.
  4. 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

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

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Re: Hide 3 from IE

Can I just say, for most Joomla! users IE is the worst browser on the planet. And you all have made our lives so much easier!!! Thanks so much for a terrific program!!

Eliyahna
Beginner Modder
ranks
useravatar
Offline
3 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10789
Newest User:
parus6
Members Online:
1
Guests Online:
180

Online: 
parus6

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked