You will usually want to associate modules with articles in some way. The modules are allocated to module positions and the module positions appear somewhere on the Web page as determined by the template. However, it is sometimes useful to have a module actually embedded within the article. Joomla core provides two ways to do that: loadposition and loadmodule.
Syntax:
loadposition
To insert a module inside an article, you publish the module to a position and load that position in the article as follows:
- Create a module and set its position to myposition. myposition can be any value that doesn't conflict with an existing template position. Type in the position myposition and press enter instead of selecting it from the drop-down list.
- Assign the module to All the Menu Items. This will make sure that it always appears, no matter how the visitor got to the article. The module will not show unless you put the command to load the module in an article.
- Edit the articles where you want this module to appear and insert the text in the article at the place where you want the module.
*Note that this only works when the Content - Load Module plugin is enabled. If this plugin is disabled, the text shows unchanged in the article. Also, the name of the position should be all lowercase. CamelCapitalization will fail.
loadmodule
An alternative to "" is the "" variation which is handled by the same plugin.
In this case the plugin looks for the first module who's type matches the string 'yyy'. So you could load a "mod_login" module by placing in your text. If you wish to load a specific instance of a module, because you have more than one login module e.g. titled as Login 1, Login 2, etc. you have to use where mod_modType would be mod_login and modTitle is name/title given to your instance of that module. So in the example above you end up with . You can also add the style that is used for rendering the module. To do so, add the style as the third parameter like . If you don't add a style, then "none" is used.
Modules within Modules
It is possible in Joomla! 2.5+ and Joomla! 3.x+ to include a module within a "Custom HTML" module. They are processed by content plugins in the same way as articles.
To make this work, the option Prepare content must be enabled as shown in this screenshot.