How do you put a module inside an article?

It would be helpful to have a module that can be inserted within the article. Yes, Joomla provides a syntax through which you can insert any module through its ID, name or position.

The first thing you need to do is enable the plugin: Content - Load Modules. Check its status in Plugin Management.

Syntax:

{loadposition position[, style]}

{loadmodule mod_type,the title[, style]}

{loadmoduleid moduleId}

loadposition

In order 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 {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 whose 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 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 {loadmodule mod_modType, modTitle} where mod_modType would be mod_login and modTitle is name/title given to your instance of that module.

In the example above you end up with {loadmodule mod_login Login 2}. 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.

 

loadmoduleid

Since Joomla! version 3.9.0 an alternative to {loadposition xx} and {loadmodule yyy} is the variation {loadmoduleid z} which is handled by the same plugin.

In this case the plugin looks for the module whose id matches the number z. You could load the module with id 200 by placing {loadmoduleid 200} in your text. This variant does not "understand" additional parameters such as the style parameter.

 

Source: https://tinyurl.com/52xjp33x

You may also like

Country Blocker Tool for Joomla

K2 to Content Migration

The Best Articles Comment Extensions on Joomla 4

Say something here...
You are a guest ( Sign Up ? )
or post as a guest
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.


Powered By JLex Comment.