How do I get the module parameter inside a component in Joomla 1.5? I am using this code but it displays an empty result.
jimport( 'joomla.application.module.helper' );
$module = &JModuleHelper::getModule( 'mod_used_car_image');
$params = new JParameter($module->params);
print_r($params);
I got the params value. Use this code to get it:
jimport( 'joomla.html.parameter' );
jimport( 'joomla.application.module.helper' );
$module = JModuleHelper::getModule('mod_name');
$moduleParams = new JRegistry();
$moduleParams->loadString($module->params);
$position = $moduleParams->get('position', '1');
You need to call the 'name' of your module, not the 'type' of module.
Let's say you named your module 'Used Car Image', your code should be:
jimport( 'joomla.application.module.helper' );
$module = &JModuleHelper::getModule( 'Used Car Image');
$params = new JParameter($module->params);
print_r($params);
Here's the manual:
http://docs.joomla.org/JModuleHelper/getModule
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With