How to include modules in Content item (for Joomla 1.0.x)?
Written by kksou   
Saturday, 29 March 2008

This is in reponse to Ssnobben's posts titled "Having a slideshow module in main page" and "Slideshow on frontpage"

To illustrate what he means, I've included a live example right here.

I do not have the Frontpage Slideshow module he mentioned (it's commercial, cost 22 EUROS I think). But I happen to have another another similar slideshow module.

If you go to, say, http://www.kksou.com/php-gtk2/sample-codes/, you can see that it's a module by default appearing in one of the module positions on the left.

On the left, you can see that it has been embedded right inside this content page.

What's even more amazing is that you can use any of the HTML elements to position the embedded module precisely! In this example, I used a standard HTML table to position the module to the left of the text.

How this is done?

Embedding a module inside a content page is a Joomla "feature". You do not need the DirectPHP plugin to enable this.

Ssnobben has rightfully pointed out you need to use something like "{loadmodule mod_fpslideshow}". So below are the complete steps to achieve this.

Note that the steps below applies to Joomla 1.0.x only. For Joomla 1.5.x, please refer to How to include modules in Content item (for Joomla 1.5.x).

Step 1: Create a new module position

First, we need to create a new module position where this module will be placed.

  1. From the "Site" menu, select "Template Manager" then "Module Positions" as shown below:
  2. Add a new module position "user201". You could give it any name. I named it "user201" in this example.
  3. Click "Save" to save the new module position.

Step 2: Create the content page

We will now create a content page for containing the module.

  1. Go to Content Manager and create a new article (static or dynamic).
  2. In the article, enter the following:
  3. This is a test to include a module inside a content item.
    
    {mosloadposition user201}
    

  4. Note that the module name after mosloadposition has to match the module position you have created in Step 1.

Step 3: Set up the module

In this step, we need to do some setting so that the module will appear in the module position.

  1. Let's first create a module for testing purpose. Go to "Modules - Site Modules". Look for the module "Main Menu". Check the box besides the title, and choose "Copy" from the menu.
  2. You will see a new module called "Copy of Main Menu" appearing below the original "Main Meu".
  3. Click on "Copy of Main Menu".
    • Set "Show Title" to "No"
    • Select "user201" for Position
    • Set "Published" to "Yes"

  4. Go to "Page / Items" on the right-hand side and make sure "All" is selected:
  5. That's it! Save the module. We're all set!

Step 4: Let's test it

Now load the article. Did you see the "Main Menu" appearing inside that article similar to the following?

Note: If you wish to put this as the front page, go to Menu Item Manager - Main Menu, create a menu item linked to this content page, then move it to the first item. The content page with the embedded module (for example, it could be a slideshow module) will become the front page.

Links


Last Updated ( Saturday, 29 March 2008 )
 
< Prev   Next >

Blog - Forum - Privacy Policy - Contact Us
Copyright © 2006-2015. kksou.com. All Rights Reserved