Actions

Difference between revisions of "How do you put a module inside an article?"

From Joomla! Documentation

(adding more already developed options to the loadmodule tag, so people can use the full power of this plugin)
m (english grammar)
Line 15: Line 15:
 
An alternative to "{loadposition xx}" is the "{loadmodule yyy}" variation which is handled by the same plugin.
 
An alternative to "{loadposition xx}" is the "{loadmodule yyy}" variation which is handled by the same plugin.
  
In this case the plugin looks for the first module that who's '''type''' matches the string 'yyy'. So, you could load a "mod_login" module by placing {loadmodule login} in your text. If you like to load a specific module, because you have more than one login module e.g. titled as login1, login2, … loginN you have to use {loadmodule login,login2} for the module titled as login2. Furthermore you can add the a style that is used for rendering the module, to do so add the style as third parameter like {loadmodule login,login2,xhtml}. If don't add a style "none" is used.  
+
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 {loadmodule login} in your text. If you wish to load a specific module, because you have more than one login module e.g. titled as login1, login2, … loginN you have to use {loadmodule login,login2} for the module titled as login2. You can also add the a style that is used for rendering the module, to do so add the style as third parameter like {loadmodule login,login2,xhtml}. If you don't add a style then "none" is used.  
  
 
===Modules within Modules===
 
===Modules within Modules===

Revision as of 13:29, 30 December 2013

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.

To insert a module inside an article, you publish the module to a position and load that position in the article as follows:

  1. 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.
  2. 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.
  3. Edit the articles where you want this module to appear and insert the text {loadposition myposition} in the article at the place where you want the module.


loadmodule

An alternative to "{loadposition xx}" is the "{loadmodule yyy}" 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 {loadmodule login} in your text. If you wish to load a specific module, because you have more than one login module e.g. titled as login1, login2, … loginN you have to use {loadmodule login,login2} for the module titled as login2. You can also add the a style that is used for rendering the module, to do so add the style as third parameter like {loadmodule login,login2,xhtml}. If you don't add a style then "none" is used.

Modules within Modules

It is possible in Joomla! 2.5+ to include a module within a "Custom HTML" module as they are processed by content plugins in the same way as articles. Provided its option to prepare content is enabled.

You should remember when doing this that you may experience formatting issues as the "chrome" of the "Custom HTML" module will surround the "chrome" of the included module potential having undesirable effects of the formatting or layout.