Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Hide module when user are connected
Hide module when user are connected
Hide module when user are connected
Hi,
i want to hide simply a module
I insert this code but the modul doesn't appear when i'm not connected.
// Hide module when connected
if ( MM_LOGGED_IN ) { $changes->mod(156)->disable();
}
The Module #156 Assignment is on "No page"
It is enable for publication.
I test metamod with a simply return and the modul appear in the good position module.
Regards.
Re: Hide module when user are connected
Hi,
I assume you are using the Pro version? The "disable" method above can only work with the Pro version.
Anyway, you are also mixing up 2 different techniques:
1 - using disable(). When you do it this way (with MetaMod Pro), the module has to be active and assigned to a valid page and module position. That way, it will appear as normal unless the MetaMod explicitly disables it. So the problem you are having at the moment is that it's not showing up because it's not assigned to a page.
2 - the traditional usage of MetaMod, which is that the PHP code returns the value of a module id. If it does that, the module is displayed. If it doesn't, the module does not display. In this case, the module should be set up like you did it, assigned to "no page" so that it DOESN'T show up unless MetaMod includes it.
So using #2, you could do this:
if ( ! MM_LOGGED_IN ) { return 156; }
Cheers,
Stephen
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Hide module when user are connected
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7628
- Newest User:
- horlogekorting34
- Members Online:
- 0
- Guests Online:
- 167
- 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