CMS: Add new module position in content OR in component file

CMS

As far as customization concern Joomla become very famous for its flexibility of each parts. In some cases we need to use module in content section or within content. So how we can make it possible?

Here we I explain two way based on where we have requirement of module.

Load module in article :

->If we have such case in which we have to put our module within article OR within our component section. That time we just have to put

{loadposition position_name}

short code to load position. Then set required module to that particular position. If position is new then don’t forget to add this position in templateDetails.xml file. Check if the plugin load module is enable . Now you can load module by selecting this position to anywhere within content.

Load module in custom component file:

->When we are making any custom component or trying to customize existing component and for some functionality we require to add position to that particular component then we can load position by using below code:

$modules = JModuleHelper::getModules('positionname');
foreach($modules as $module)
{
echo JModuleHelper::renderModule($module);
}

Here in place of position name you can write any position name which you wish to load. Then follow same procedure as above. This way doesn’t require any plugin support. This is we are doing by custom code.

Hope this helps you guys…

Keep it up..
Coreway Solution 🙂

More resources like CMS
GET
100%

satisfaction
or
Get Your Money
Back

Just for you

pdf_icon_case

Download our WP checklist below and review your Wordpress site's performance today for free

DOWNLOAD

interested?

Let's Discuss Now