Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » How to php script a module
How to php script a module
Re: How to php script a module
Hi RC2012,
Please read the Quick Start guide: http://www.metamodpro.com/metamod/quick-start
That will explain the basics of how to prepare the modules.
Then:
1 - prepare the 2 "target" modules, by setting them to "menu assignment: none"
2 - create the MetaMod and put it in the module position that you want the other modules to appear in. Ensure it is published and set to some or all menu items
3 - use the following PHP as the basis of your PHP code in MetaMod:
if ( ... some conditions here, whatever you want to determine which module is going to display ...) {
return XXX;
} else {
return YYY;
}
Replace XXX with the module id of the module that you want to display when the condition succeeds, and YYY with the module id of the module you want to display when the condition does not succeed.
Does that help?
So you need to think about it slightly different to how you described it. Instead of thinking "I need MetaMod to hide a module and replace it with another one", you need to set up MetaMod as a switch that sometimes displays one module, and sometimes displays another. I haven't filled in all the PHP code above, as you didn't specify what the actual condition for showing the target modules would be.
Cheers,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » How to php script a module
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:
- 1
- Guests Online:
- 111
- Online:
- uistr4qx
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked