| | | |  |  | |  |
13.04.2004, 00:07
|
#1 (permalink)
| | Baby Mamber
Join Date: Apr 2004
Posts: 4
| Is there an easy way to create multiple instances/copies of a module Hi all,
I've only recently discovered Mambo, and so far after trying *all* of the other CMS-type packages (e107, phpnuke, xaraya etc..), I think it's by far the best. Anyway, on to my point;
I know a *little* PHP, but next to no Mambo, so I'm posting to ask is it possible to re-use a module, but with different parameters/title etc? I've written (well, cobbled together from various OS scripts/modules) a game server module which will give info for different types of game server (Q3, UT2003/4 etc.) and I have a module which displays serer name, map name, optionally displays a thumbnail of the current map, but I don't want to have to physically copy the module just for a different game server. I am currently specifying the id of the server in a module parameter, so I would think it's possible to reuse it with a different parameter, I just can't see how. I'm still learning Mambo, so I probably missed something *really* obvious.
Thanks to anyone who can help me. |
| |
13.04.2004, 00:14
|
#2 (permalink)
| | Senior Mamber
Join Date: Apr 2004 Location: Mo i Rana, Norway (66°19'N 14°09'E)
Posts: 214
| Re: Reusing modules I am afraid not. It is only possible to have a module displayed one place. If you want to have the same module several places as you stated, you have to give each module a different name in the module and in the installation X;L file and install each one.
__________________ "Every demand is a prison, and wisdom is only free when it asks nothing." Sir Bertrand Russell |
| |
13.04.2004, 00:18
|
#3 (permalink)
| | Baby Mamber
Join Date: Apr 2004
Posts: 4
| Re: Reusing modules Quote: |
Originally Posted by SvenErik I am afraid not. It is only possible to have a module displayed one place. If you want to have the same module several places as you stated, you have to give each module a different name in the module and in the installation X;L file and install each one. | Thanks - I was just about reaching that conclusion  Thought I must have missed something. OK, I'll have to either change the parameters to be a comma-separated list of servers, or create separate modules - one for each gametype - won't be hard, I just hoped it would be easier
Thanks again |
| |
13.04.2004, 08:52
|
#4 (permalink)
| | Professional Mamber
Join Date: Apr 2004 Location: Marikina, Manila, Philippines
Posts: 776
| Re: Reusing modules Actually it is possible to have multiple instances of a module without actually have to physically create multiple seperately named copies of your module.
What you have to do is play with the database.
The mymenu component is based on this very premise as it creates multiple instances of the mod_mainmenu.php module.
So how do you do this, read here for alwarren's ecxcellent howto: http://forum.mamboserver.com/viewtop...183&highlight=
And yes you are able to set different parameters for your modules once they have been created.
It is also the premise that is underpinning my component discussed here: General Component Programming Question
I am looking at extending the components ability to allow the creation of multiple instances of any module, just got to figure out how people will be be able to add their own modules to the list.
__________________ Joomla! Core Team Member
Software Coding & Design - Stability Team Leader www.joomla.org Former Mambo Core Team Member |
| |
13.04.2004, 10:41
|
#5 (permalink)
| | Baby Mamber
Join Date: Apr 2004
Posts: 4
| Re: Reusing modules Thanks - I'll check that out. |
| |
13.04.2004, 12:00
|
#6 (permalink)
| | Senior Mamber
Join Date: Mar 2004
Posts: 121
| Re: Reusing modules Quote: |
Originally Posted by stingrey Actually it is possible to have multiple instances of a module without actually have to physically create multiple seperately named copies of your module.
What you have to do is play with the database.
The mymenu component is based on this very premise as it creates multiple instances of the mod_mainmenu.php module.
So how do you do this, read here for alwarren's ecxcellent howto: http://forum.mamboserver.com/viewtop...183&highlight= | I've also added the howto to Mosforge to protect it from forum pruning - http://mosforge.net/snippet/detail.p...=snippet&id=13 |
| |
13.04.2004, 14:09
|
#7 (permalink)
| | Junior Mamber
Join Date: Apr 2004 Location: Orlando, Florida
Posts: 27
| Re: Reusing modules Quote: |
Originally Posted by stingrey What you have to do is play with the database.
The mymenu component is based on this very premise as it creates multiple instances of the mod_mainmenu.php module. | Shhhh....you are giving away all my secrets!!!!  |
| |
14.04.2004, 07:26
|
#8 (permalink)
| | Professional Mamber
Join Date: Apr 2004 Location: Marikina, Manila, Philippines
Posts: 776
| Re: Reusing modules Quote:
Shhhh....you are giving away all my secrets!!!! | Ok, no worries...mum's the word (how did that phrase ever come about, oops I'm digressing), your secret is safe with me.
So long as you promise not to tell anyone, especially that jason fellow that I'm, using his component as a basis for my component
Remember, secret squirrel 
__________________ Joomla! Core Team Member
Software Coding & Design - Stability Team Leader www.joomla.org Former Mambo Core Team Member |
| |
29.04.2004, 04:50
|
#9 (permalink)
| | Senior Mamber
Join Date: Apr 2004 Location: New Orleans
Posts: 167
| Re: Reusing modules Dang
That didnt work, I set the modules up, and I do indeed get two copies of the same module, but what I put different parameters in for the weather location I get the same weather on bout modules
Check out www.jonezing.com click on the Roanoke and New Orleans sections and watcht the MyWeather module, some things change but its giving me the same weather for both places
WHat do I do now?
Can you make seperate copies if you have to?
TJay |
| | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT +2. The time now is 03:26. | | | |