Load a Module in the Article Content PDF Print E-mail

This basic tutorial will guide you through the steps of loading the content of a Joomla! module directly into the content of an article.

The functionality that allows for module loading in the content of a Joomla! article is included with your Joomla! 1.5.x installation, it may not be enabled by default however. Follow these steps to configure Joomla! to enable module loading in the content of an article.

Configure the Content - Load Module Plugin:

To enable the ability to load a module in your Joomla! web site, you must configure the Content - Load Module Joomla! plugin.

Open the Joomla! Plugin Manager, from the Joomla! Toolbar:

Extensions > Plugin Manager.

Locate the Joomla! Plugin named 'Content - Load Module' and either click on its name, or fill the check box in the left hand column and click the 'Edit' icon near the top right hand side of the administrator screen.

Joomla! Content - Load Module Plugin Details

Content - Load Module Plugin Details settings:

  • Name: This is the Name of the Plugin: "Content - Load Module".
  • Enabled: Set whether or not the plugin is enabled (active). This should be set to 'Yes' if you want to load module positions within the content of an article.
  • Type: This is the Plugin type: "content".
  • Plugin File: This is the php file which contains the PHP code to execute. You should leave this value unless you have created a custom Load Module plugin for your Joomla! installation.
  • Access Level: This item allows you to select what types of users will be able to see the Plugin output.
  • Order: This value can be changed by modifying the order from the Plugin Manager screen and clicking the Save icon.
  • Description: The plugin description: Loads Module positions within Content...

Joomla! Content - Load Module Plugin Parameters

Content - Load Module Plugin Parameters:

  • Enable Plugin: Set whether or not the plugin is enabled. This should be set to 'Yes' if you want to load module positions within the content of an article.
  • Style: Select the output style for the content of the module, each module (if there are more than one) for the content position will be displayed using the selected wrap type.
    • Wrapped by table (column): Each module will be in a <td> cell on its own row (vertically).
    • Wrapped by table (horizontal): Each module will be in a <td> cell in a single row (across the screen).
    • Wrapped by Divs: Each module will be wrapped in a <div> tag.
    • Wrapped by Multiple Divs: Each module will be wrapped in multiple <div> tags, allowing for a rounded CSS background.

Content - Load Module Syntax to Add in Article Content:

Once you have made certain that the Content - Load Module plugin is configured and enabled, adding the code to your article content is quite simple. The syntax to load a module into the content of an article is as follows:

{Xloadposition content} (Remove the X)

In the above example, the Module Position that will be loaded is named 'content', you can load any content position using the loadposition syntax. Note, it may be best if you define positions specifically for loading this type of content, or use one of the module positions enabled only for this type of content.

To demonstrate the above example, I have created a simple Poll module which loads in the 'content' position, and enabled it to appear directly following this text:

Displaying a Module within a Joomla! Article is simple!
 

 

You can see above that the Poll module is loaded within the content of this page, like I mentioned earlier, you can load any Joomla! Module position into the content of your Article. There are a few more items that you need to take into account in order to ensure that your module content will display within the content of your page.

Configure the Module to Display Within Your Article Content:

First the Article which you wish to have the Module loaded into needs to be added to a Menu, and published. Navigate to the Module Properties page by selecting to Edit the module from the Joomla! Module Manager (Extensions > Module Manager). Select the Menu Items you wish to have your Module loaded into, and Save the Module configuration by clicking the Save icon near the top right hand side of the page.

Joomla! Module Menu Assignment Configuration

Loading a Module in Article Content Summary:

If you have tried the steps above, make sure you have configured the Content - Load Module plugin correctly, setting both of the 'Enable' parameters to 'Yes'. Also remember, the page you wish to load our Joomla! module into must be in a menu, and both the Article and Menu Item need to be 'Published'. If you have verified both of the previous items, and you still aren't getting your module to load within the Article content, make sure you have added the Module to the correct Module Position, and check the spelling of the Module Position within the Article content.