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.


Hide module after login on some pages

Hide module after login on some pages

I want to hide the some modules on home page after login but show these modules on other pages of the website.means like slider module hides on home page after login but show on other pages of the website

Edited By: mithun
03-Jun-13 05:48:47

Beginner Modder
1 Posts
Administrator has disabled public posting

Re: Hide module after login on some pages

Hi Mithun,

Ok, I think you are wanting this:
- module shown on home page and some other selected pages for guests
- when user is logged in, module is to disappear from the home page, but remain on other pages.


Ok, here's how to do it:

1 - read the Quick Start guide: http://www.metamodpro.com/metamod/quick-start
2 - set up your "target" module: the one you want to appear/disappear on those pages. When you set it up, set it to appear on "menu items: none". We'll do the allocation of which pages to appear on, in the MetaMod setup.
3 - set up a new MetaMod and assign it to the front page and the other pages you want it to appear on.
In the MetaMod, use the following PHP:

if ($user->id == 0 or $Itemid != XXX) return YYY;

Replace XXX with the Itemid of your home page (i.e. the id of the menu item, which you can find in the menu manager next to the menu item for the home page).
Replace YYY with the module id of your target module.
Ensure that the MetaMod is published, set to a valid module position, and set to dsplay on the correct menu items.


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

3314 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
Total Topics:
Total Polls:
Total Posts:
Total Posts Today:
User Info:
Total Users:
Newest User:
toko solo
Members Online:
Guests Online:

There are no members online

Forum Legend:

 New Sticky