PDA

View Full Version : 2 modules, same php file, 2 different templates?


ragintajin
11-06-2005, 02:05 AM
Hey Brian,

I'm trying to have 2 different modules, both using the same php file (latesttopics.php). I want each module to have its own style, thus use its own template. The first template is the default one (adv_portal_latesttopicbits) and the second template is custom (adv_portal_latesttopicbits_games).

In the second module, I revised the Templates Used to include: adv_portal_latesttopicbits_games, adv_portal_latestthreads_head

Both modules are showing but for some reason they are both using the default template, adv_portal_latesttopicbits.

Any ideas?

Brian
11-06-2005, 01:58 PM
You would also need to modify the code in your latesttopics.php file to tell it what template to include. Look in the file for this:
eval('$home["$mods[modid]"][\'content\'] .= "' . fetch_template('adv_portal_latesttopicbits') . '";');

And replace with something like this:
eval('$home["$mods[modid]"][\'content\'] .= "' . fetch_template(iif($mods['modid'] == X, 'adv_portal_latesttopicbits_games', 'adv_portal_latesttopicbits')) . '";');
(Replace the X there with the moduleid of your games module.)

Our Sponsors
 

ragintajin
11-07-2005, 12:56 AM
Works great, thanks for the speedy reply!