Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Display multiple modules
Display multiple modules
Re: Display multiple modules
Hi Rooney,
yes, no problem.
If you are using the Quick Module ID Include, then you can put in a comma-separated list of ID numbers.
If you are using a PHP rule, then put in the list of ID numbers in quotes, like this: if (...) return "101,102,331";
Another way to approach this is to put all the target modules into a new (fake) module position, then you can pull them all in together by returning the name of the module position instead of individual IDs. This means that you can change what goes in and what goes out simply by assigning arbitrary modules into/out of that module position.
example:
in Quick Module ID box, just enter the name of the module position,
in a PHP rule: if (...) return "my_new_position";
Cheers,
Stephen
Re: Display multiple modules
Thanks for your answer, but what I wanted to archive is the following:
if ( MM_DATE <= 20100222) return 34;
if ( MM_DATE <= 20100306) return 35;
Means I want to use one instance of MetaMod to display modules by date.
If I add multiple php statements, only one module is displayed.
Rooney
Re: Display multiple modules
Oh, so you want to make it cumulative? e.g. you want to be able to set a number of rules, each one of which may add another module to the list that are displayed.
That's a great request -- I haven't really documented this sort of use anywhere, though I think a couple of the recipes on the site use something similar.
To do this, we'll set up an "array" at the beginning of the rule. It's a sort of collection to which we can add extra module IDs as we go through the rule. At the end, we just return the array. MetaMod is smart enough to go through the array and create a module for each ID.
Code:
$ret = array(); // start with empty array
if ( MM_DATE <= 20100222) $ret[] = 34; // add "34" to the array
if ( MM_DATE <= 20100306) $ret[] = 35; // add "35" to the array
return $ret;// it's ok if this is empty, it just returns no modules.
Hope that helps,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » Display multiple modules
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5944
- Posts this week:
- 1
- User Info:
- Total Users:
- 7669
- Newest User:
- norton4568
- Members Online:
- 1
- Guests Online:
- 164
- Online:
- norton4568
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked