Creating Modules
STYLE--> STYLE-->
Custom Modules
There are a couple of situations where you may need to create a custom module. In the example illustrated in Figure 10, the goal is to include an affiliate marketing ad in the left column of my Web site.

Placing a graphic with a module
From a traditional Web development perspective, many developers are inclined to hard-code the graphic into the template for the site. This creates multiple problems. First, if I change templates, I have to remember to modify the new template to include everything that was hard-coded. Second, if the ad or other graphic changes, site owners now have to rely on a developer to make what is otherwise a relatively simple change.
The solution is to create a module that essentially acts as a wrapper for the graphic or other content that you need to display. To begin the process, go to the Module Manager in Joomla and select the New icon in the upper righthand corner of the screen.

Create a New module
You’ll notice that Joomla offers a variety of options for creating custom icons. In this situation you’ll want to select “Custom HTML” and click next. The bottom half of the final screen in the process should look similar to the article editor in Joomla (see Figure 12).

Adding Custom Output to your module
In the “Custom Output” editor, select Source. Write your native HTML or other code, then switch back from source view. You should see a preview of your graphic in the window. Before you save your work, double-check that the following items are configured correctly for your module. The parenthetical items in the list are suggestions for typical settings, as applicable:
· Show Title (No)
· Enabled (Yes)
· Position
· Order
Save and preview your work.
The second scenario that may lead you to develop a custom module for your site are in situations where you want to include a snippet of content from a component, but not link to the complete component itself. For example, Figure 13 is a Top 5 list of the most popular downloads from Docman on my site.

Add snippets of content to your site using a custom module.
The process for creating this kind of module is really no different than the process for creating one based on “Custom Output”, as described above. In this case, after selecting “New” (Figure 11), all you need to do is choose the type of module you want to create. In this case, I selected Docman most downloaded, and then configured it on the subsequent screen. In addition to configuring the same items described in the previous example (publish, order, position, etc.), I had the option to choose whether or not to display a file icon, the number of items to publish, and whether or not to display the number of downloads.





