Saturday, 14 April 2007

mod_html - one of the most useful Joomla modules

Article Audience: Webmasters

The mod_html module has been described as the Joomla swiss army knife. It allows you to insert arbitrary html in any template position available.

The mod html module is an extremely simple module, with no limits to its use. It simply provides a wrapper for you to insert arbitrary HTML / Javascript code in your Joomla website. The great thing about it is that you are able to insert adverts or other code without having to modify your template thus you have no risk of breaking your template in some way.

  • Inserting advertising code for affiliate programs
  • Inserting code for Google Adsense
  • Inserting Javascript for generating funky menus
  • Inserting flash components

By creating a copy of the mod_html component, you can use the modules for as many links / adverts as you need! Simple go to the Module Manager Extensions > Module Manager (or Modules > Site Modules) or, click on a module which uses mod_html, select its checkbox and create copy in the toolbar menu, and you have a new copy to work with. Click on the copy of the mod_html , change the required parameters, change the HTML and publish. You can create as many mod_html modules as you want. By combining the use of mod_html with intelligent menu navigation, you will be able to target specific adverts to specifc pages, rather than having generic adverts all over the website.

For example in the image below we can see that for the current module, instead of selecting the All option in the Menu Items, we have created a section (with its categories as children in the menu). We then selected the Affordable Web Development (which automatically selects its children too). Thus this advert has been targeted to the current section (and its categories) only. This is great when you have different affiliates for different parts of your site. Example you have template affiliates (and you target your templates section), and other affiliates for other sections of the site (and thus target each section with its own affiliates).

Target specific pages

Inserting AdSense Code 

Lets give a short example of the use of mod_html to display AdSense code. The following is a shot of the module setup for displaying adsense code on the left side of the screen.

Inserting adsense code using mod_html

Inserting Affiliate Code

In the example below we have different code for affiliates. As can be seen on this site itself, you can see that both mod_html components can live independently of each other.

Inserting affilate code

 

 

 

 

 

 

Warning: Remember that this is a 3rd party module and may compromise your site's security. In this case the risk may be even larger because code you insert may create additional vulnerabilites. Always make sure that your code comes from a trusted source.

Comments
Search RSS
Denis  - Great module thanks   |216.104.204.xxx |2007-05-29 11:10:17
This module is great and answeres my prayer to be able to dispaly codes where I
want.
Seyfullah Ural  - Great But   |85.104.67.xxx |2007-06-11 20:26:49
It is indeed a very useful module but the code to be entered must be 1-line.
Otherwise module will insert tag to the end of each line.
Denis  - mr   |217.172.18.xxx |2007-07-24 11:57:05
is great
Jorge  - How to show in the FrontPage?   |201.222.118.xxx |2007-11-15 13:16:48
The module works fantatic, but what I have to do if I want to show in the front
page some custom's code.

Thanks for advance.
DART Creations  - Show in Frontpage   |85.232.198.xxx |2007-11-21 21:09:44
Jorge, what I do in this case is I create my own position in the template and
put it where you want to show the custom code.

Then create a copy of this
module, assign it the module position you created and as parameters where to
show it select only the frontpage.

If you have problems created a module
position in your template, I have a good article on module positions under
Joomla tutorials.
Kherlen  - Thank you   |71.30.164.xxx |2007-12-11 11:52:57
Thank you sooooooooo much, I have been struggling with the third party codes.
Thanks, keep up the good work!!
Manny  - Thanks   |210.213.144.xxx |2008-05-07 00:22:40
This module is indeed very useful in my joomla site.
xseiglan  - How to add Html (& Javascript   |Registered |2008-07-30 12:59:12
Hi,
your great module works very fine in my front page. But I would like to do
the same within my articles. What do I have to do ? I am with Joomla 1.5 (and a
new-b).
Thanks a lot for your answer.
DART  - Withing Content   |Registered |2008-07-30 15:16:39
Try the following:

http://www.dart-creations.com/joomla/

tips-and-tricks/
10---load-module-positions-mambot .html
MeanneDulohan  - how to put the google search a   |Registered |2008-09-30 07:51:36
hi!
i just want to ask how to put the google search at the topmenu or at the
breadcrumbs??

thank you in advance??
proactive products cost     |59.95.173.xxx |2009-03-09 09:19:47
does it work with joomla 1.5
DART  - Joomla 1.5   |Administrator |2009-03-09 11:37:31
Yes, check out the downloads section!
Only registered users can write comments!

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated ( Wednesday, 23 September 2009 )