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 after x seconds
Hide module after x seconds
Hide module after x seconds
Hi there! I've been searching in forum something like I'm asking, so it is, how to hide a module after some time (for example, one minute) an user (registered or not) enter the site. Is that possible with metamodpro?
03-May-13 13:29:52
Re: Hide module after x seconds
Hi again. I'm trying around with this recipe http://www.metamodpro.com/metamod/recip … er-session that could be good for me.
I want module '306' to be shown in 'advert10' position just once the first time that an user views a certain page and not to show that module next times
$instance_name = "shown_module_1";
if (!isset($_SESSION[$instance_name]) ||
$_SESSION[$instance_name] == false) {
$_SESSION[$instance_name] = true;
$changes->mod(306)->position( 'advert10' );
However, it doesn't work, the module is shown every time. Am I missing something?
Re: Hide module after x seconds
Hi pararrayos,
If you are using MetaMod Pro then this should work, but may not with the free version. This is because with the Pro version you can use the $changes mechanism to address ANY module on the page, not just the ones you are returning from the MetaMod (which you aren't, in this case, so I expect you are using Pro).
To keep it simple I wouldn't use the $changes mechanism here. I'd simple put the MetaMod into the advert10 position, and do the following:
$instance_name = "shown_module_1";
if (!isset($_SESSION[$instance_name]) or $_SESSION[$instance_name] == false) {
$_SESSION[$instance_name] = true;
return 306;
}
(I also note that you were missing an important closing "}" in your PHP. That could have been part of the problem too).
Hope that helps,
Stephen
- Index
- » MetaMod Pro
- » MetaMod Pro General Support
- » Hide module after x seconds
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5941
- Posts this week:
- 1
- User Info:
- Total Users:
- 7618
- Newest User:
- goure1dhowen
- Members Online:
- 0
- Guests Online:
- 140
- 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