You are here:Home»KB»Web Design»CMS»Joomla»Embedding a Module into a Joomla Article
Wednesday, 28 October 2015 12:33

Embedding a Module into a Joomla Article

Written by

There are 2 inbuilt Joomla plugins to load modules into content. These in-built plugins cannot load modules by their ID so you will need to use a 3rd party extension for that. There are some great 3rd party plugins that will also allow you to insert modules into content but by the module ID if you want.

[loadmodule] and [loadposition] Plugins

Unless you know how to use these powerful features or even the syntax you will find them very difficult to use. There usage is slighty different but the syntax is very similiar so if you can use one you can use the other. With both the plugins don't forget you will need to enable it in the Plugin manager. If you want a module to appear you must make sure that it is published. You also need to make sure the module is visible on the pages you want in its menu tab, or you can restrict it.

[loadmodule]

This plugin allows you insert modules into content by specifying the module group ( ie custom / custom_html / login / mod_login ). I have not check which variations od the module group names work and where to get them from. If there is more than 1 module published in that group they will all be publish, so if you only want 1 module to be embedded you need to specify the title of the module. You can specify a module by it's name even if there is only 1 module in that group, it does not ahrm. The last switch is for styling and i am not sure exactly how to use it.

Syntax
[loadmodule moduletype,title,style]

Examples
[loadmodule custom] - This will load all of the 'Custom HTML' modules that are published
[loadmodule custom,My Code] - This will load the 'Custom HTML' module titled 'My Code'

NB: Swap [] for {} - I used brackets instead of curly braces so Joomla did not parse the demo text.

[loadposition]

This plugin will load all modules from the specified position one after the other.

The way to use this to get a specific module to display in your content is to create your module and assign it to a custom module position. To put a module in a custom position, when you edit the module rather than using the drop down menu to select a position you can just type your own in (i.e. myposition) and then save the module.

Syntax
[loadposition position,style]

Examples
[loadposition right] - This will load all modules in the right module position.
[loadposition myposition] - This will load all modules in the custom module position called 'myposition'.

NB: Swap [] for {} - I used brackets instead of curly braces so Joomla did not parse the demo text.

Getting the Module's Type

  • You can get the module's type from the module list in joomla. This only gives you an indication of the modules name
    i.e. BT Google Maps
  • You then get the modules required name from your website via ftp. Browse to /modules/ and in there you will see the modules name which should be similiar to the name above. In some circumstances the names might not be similiar.
    i.e. mod_bt_googlemaps

3rd Party Extensions

Links

Read 1268 times Last modified on Thursday, 12 May 2016 09:50