Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Loading two module positions from one...
Loading two module positions from one Metamodule
Loading two module positions from one Metamodule
I have two module positions one holds an image and one holds some text. The text discribes the image (special offers etc) and overlays the image via css. I don't want the text to be in the image file and needs to be changed by the user.
I would like to randomly display the image but also the matching text module to go with it.
Could anyone suggest a way to do this please?
So say if module no 7 is loaded module no 24 is loaded too in user1 and user2 ?
08-Oct-12 20:54:25
Re: Loading two module positions from one Metamodule
ok, I think it's going to be easy enough to put the logic into the 1st MetaMod, then put the corresponding module id into a global variable to pick up in the 2nd module position.
So in the 1st module position, something like this:
$r = mt_rand(0, 5);
$images = array(33, 34, 35, 36, 37, 38); // 5 image modules
$text = array(101, 102, 103, 104, 105); // 5 text modules corresponding to image modules
global $metamod_text;
$metamod_text = $text[$r]; // used in other module
return $images[$r]; // for this module position, show image
Then in the 2nd module position (or just 2nd MetaMod):
global $metamod_text;
return $metamod_text; // for this module position, show text from other MetaMod
Hope that helps,
Stephen
Re: Loading two module positions from one Metamodule
d'uh! Yes, of course it should have been mt_rand(0, 4) meaning 5 possible images and text. Sorry for putting you wrong there.
Best regards,
Stephen
Re: Loading two module positions from one Metamodule
I've searched for this question but I don't know if I've phrased it correctly. I'm working on a Joomla website and on one of the pages I have three module positions content-top-a content-top-b content-top-c So essentially the page width is divided into thirds.
urls deleted by admin
- Index
- » MetaMod
- » MetaMod General Support
- » Loading two module positions from one...
Board Info
- Board Stats:
- Total Topics:
- 1699
- Total Polls:
- 6
- Total Posts:
- 5967
- Total Posts Today:
- 2
- User Info:
- Total Users:
- 8027
- Newest User:
- henley7346
- Members Online:
- 1
- Guests Online:
- 172
- Online:
- henley7346
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked