Monday, 04 August 2008 11:26
If you hang out in the IRC channel for Joomla, you'll often see Dr. Digital hanging out there. He's a good guy to get help with Joomla—just make sure your site is updated before you do! Anyways, I was reading his website and he has an article about using HTML and Javascript with modules. Dr. Digital recommends using the "No Editor" option when creating a module that contains HTML or Javascript. It can be a real pain to switch back and forth between No Editor and the JCE Editor, however. Here's a better way:
Usually when a module is created with text or graphics of your own design, using the type "Custom HTML" works just fine. However, if you are using code snippets given to you by other sites, especially those like Amazon, Google Adsense, and others, "Custom HTML" often doesn't work, and you'll get frustrated really quickly!
The quick fix is pretty easy: download a third party module that will let you insert plain HTML and/or Javascript. Check out the category Custom Code at the Joomla Extensions Directory. The one I'm using is called MoeDesigns - AnyCode - Joomla 1.5 Native, but there are a number of extensions that do pretty much the same thing.
This is what AnyCode looks like:

It's a little hard to make out, but all you have to do is paste your code into the "Module Parameters" field. Give it a title, set the position, and you're done.
This is exactly what I do to run the Amazon recommendations on the site.
© (c) 2009 - 2010 Joomla Podcast