How to display modules anywhere in component in joomla

Sometimes we need to display a module between the content of our component, Joomla doesn’t provide the functionality to assign location in a component in template file. therefore we need to add some custom code to display a specific module at that position.

images

Code

//first of all import module helper file

jimport(‘joomla.application.module.helper’);

// give the name of module in the function

$module = JModuleHelper::getModule(‘mod_jevents_latest’);

JModuleHelper::renderModule($module);

echo $module->content;

Published
Categorized as Blogs

Leave a comment

Your email address will not be published. Required fields are marked *

Time limit exceeded. Please complete the captcha once again.