PDA


View Full Version : Use same module code in multiple modules?


Tom M
05-09-2005, 11:25 PM
I'm trying to dynamically drive a module based on the module id. The module code is working however when the page executes only the 'first' version of the module encountered displays any output.

While I can easily duplicate the module and edit the two copies it seems a waste as everything is the same except for some minor configuration information. Dumping the $modules array and looking at it seems to indicate this should work. They have different titles and different modid's. They do have the same filename and use the same templates.

I tried using different filenames to bypass the 'require_once' (created two symbolic links to the same file) and it still doesn't work. It only works when the files are physically two separate entities.

Any ideas on how to accomplish this? Will such a feature be in 2.0?

Brian
05-10-2005, 12:52 PM
Can you post the code you're using?

Tom M
05-10-2005, 01:09 PM
Here's the module I'm currently working with. I've been toying with splitting it so that just the configuration stuff is in separate files and that 'template' then requires the base code.

Brian
05-10-2005, 01:37 PM
It would take a little work to get that to function with just the single file, so your best bet might be to just duplicate the file for the different modules.