December 18th, 2006

Simple Joomla module to add any HTML to any position

Create beautiful Joomla websites with a flexible layout from iJoomla.com

With all my Joomla installations, I've usually been able to find a module to provide some sort of content for a sidebar. But sometimes, you just need a bit of static HTML that isn't automatically created anywhere on your site. So I whipped together this very simple Joomla extension that just provides a textarea for you to put in any HTML you want to. That HTML is then displayed wherever you place the module.

You can see this module in operation here, the 'featured opportunity' piece on the left. And here's the link to download the module, I call it mod_anything.

Create beautiful Joomla websites with a flexible layout from iJoomla.com

28 Responses to ' Simple Joomla module to add any HTML to any position '

Subscribe to comments with RSS or TrackBack to ' Simple Joomla module to add any HTML to any position '.

  1. hannibal said,

    on December 18th, 2006 at 1:12 pm

    a lot thanks

  2. Ssnobben said,

    on December 18th, 2006 at 1:37 pm

    Simple is beautiful! :-)

  3. Star Ten said,

    on December 19th, 2006 at 2:13 am

    Great module :-)

  4. goggz said,

    on December 21st, 2006 at 6:17 pm

    just going to d/load it but have to say that previous comment (by efewfwe) is very rude (serbian/croatian languague, mentioning your mother and f-word, so it should be removed) … just don't like that kind of rudeness in joomla-mambo community - a world od sharing (give and take) shoud at least be based on some respect to others (persons, work, whatever9
    … OK, to make it shorter, i'm sure i'll like it, it is simple, and just what i need. thanx in advance!

  5. Sahar said,

    on December 26th, 2006 at 4:50 pm

    Thanks a lot, this module simply works great.

    Is it possible to add some editor to the text area (jce, tiny_mce) ?

  6. Justin Cook said,

    on December 27th, 2006 at 8:53 am

    That's an excellent idea, I'll add it to the next version!

  7. Jeff said,

    on December 29th, 2006 at 6:02 pm

    Great mod man!
    Where are these "pages" or "snippets" stored in Joomla?
    I need to know because I use a few of them and some code needs to know the directory they are in.
    Thanks!

  8. Ben said,

    on January 3rd, 2007 at 11:21 pm

    I'm experiencing a problem (or not) hoping you might be able to explain.

    If I insert a HTML table into the module, for e.g.

    this is a test

    the webpage returns the following source lines with line breaks:

    this is a test

    Any idea why? Other than that, great mod. Previous to this I was using mod_d4j_content_listing to create sidebar. This is so much easier.

  9. Ben said,

    on January 3rd, 2007 at 11:29 pm

    ooops, comments field doesn't like html code. Try again using [blockquote]

    e.g. of table inserted into module:

    this is a test

    Viewing the page source displays the following:

    this is a test

    I hope using [blockquote] works.

  10. Ben said,

    on January 3rd, 2007 at 11:31 pm

    crap… sorry… let's try [code]

    e.g. of table inserted into module:

    this is a test

    Viewing the page source displays the following:

    this is a test
  11. Justin Cook said,

    on January 3rd, 2007 at 11:33 pm

    doesn't seem to be working!

    You can email me at "justincook [at] gmail . com" with the problem, I should be able to look at it tomorrow

  12. Ben said,

    on January 3rd, 2007 at 11:35 pm

    Apologies for the previos 3 comments.
    ok, last try, I'm replacing < > with []

    e.g. of table inserted into module:
    [TABLE cellSpacing=0 cellPadding=2 width="98%" align=middle border=1]
    [TBODY][TR]
    [TD][P align=center]this is a test[/TD]
    [/TR][/TBODY]
    [/TABLE]

    Viewing the page source displays the following:
    [TABLE cellSpacing=0 cellPadding=2 width="98%" align=middle border=1]
    [br /][TBODY]
    [br /][TR]
    [br /][TD]
    [br /][P align=center]this is a test[/TD]
    [br /][/TR]
    [br /][/TBODY]
    [br /][/TABLE]

  13. Justin Cook said,

    on January 3rd, 2007 at 11:39 pm

    that would be because Joomla automatically converts \n (newline) charaters to &ltlbr /> characters

    remove all the line breaks, you should be fine

  14. Ben said,

    on January 4th, 2007 at 1:19 am

    Thanks for the prompt reply! It worked.

  15. Sean Hodge said,

    on January 20th, 2007 at 1:32 pm

    First off great mod. Really useful.

    Qustions//

    Any idea why Joomla puts tags in for spaces and returns? Any way to change this?

    I'd like to have end user be able to read source code than have it striped down. THanks.

  16. Justin Cook said,

    on January 20th, 2007 at 2:03 pm

    I'm not sure why Joomla does that, but it does. So just take out the line breaks in your code

  17. al said,

    on January 29th, 2007 at 12:22 pm

    html module needed

  18. TJ Bowden said,

    on February 16th, 2007 at 11:08 am

    Great site and add in!

  19. mario said,

    on February 18th, 2007 at 5:49 pm

    módulo do HTML necessitado

  20. Ian said,

    on February 22nd, 2007 at 4:23 pm

    asd

  21. Macfionn said,

    on March 7th, 2007 at 12:51 pm

    New here.. but love the code & comradery. Thanks much, J.C.
    Consider this site bookmarked :)

  22. Grant said,

    on March 20th, 2007 at 10:42 am

    I see a mention in the code about the CSS class. How do I go about styling this thing. I've put code in the box for links to my RSS feeds but I want them to align right which I've had no luck doing. I noticed that in the module interface if I put in a class like rssmenu then the class will be "moduletablerssmenu" and the table class is "anything_rssmenu". How do I take this info and create entries in the CSS file to get it to align right. I've put an entry like this in my template CSS file and had no luck whatsoever.

    anything_rssmenu
    {
    text-align: right;
    background: 000;
    }

    And I tried an entry for table.moduletablerssmenu too.

    table.moduletablerssmenu td{
    text-align : right;
    }

    I'm sure it's just a stupid CSS problem and something is being cascaded but maybe I'm missing something else too.

    Any ideas?

  23. Grant said,

    on March 20th, 2007 at 10:55 am

    In my re-reading my last message I got an epiphany and figured it out. This fixed it.

    div.moduletablerssmenu td{
    text-align : right;
    }

    Now I just wish Joomla didn't add div tags to each entry because it stacks them if I have more than one thing.

    For example:
    I have an RSS feed icon for all blogs that shows up on all pages and I have an RSS feed icon just for the current blog that only shows up on the current page. When you're on that page you will get two links - one for all blogs and one for the current blog. Problem is I can't have them horizontal because it inserts div tags before and after each entry. I don't see a way around this because it's probably buried in the core.. I went the lo-tek way and just have both RSS feed icons in each anything module that way Joomla thinks it's one entry.

  24. ffiedl said,

    on May 17th, 2007 at 6:25 am

    fgfgfg

  25. Villa said,

    on May 18th, 2007 at 2:22 pm

    Thanks for this. The module has been a life saver me!

  26. Rowby said,

    on October 18th, 2007 at 12:45 pm

    Hi

    Where on this site do I download the module?

    Thanks!

    Rowby

  27. Mark said,

    on January 26th, 2008 at 8:44 am

    Great mod which I love.

    There may however be a small bug when using Joomla v1.13. When using a Joomlart template and defining the Module Class Suffix as -orange a white block appears over 80% of the module towards the bottom right hand corner obscuring the text below.

    Any ideas how to 1) get round this other than use versions of Joomla earlier the 1.13 2) how to fix it.

    Thanks for your help.

    Mark

  28. Ben said,

    on February 1st, 2008 at 4:41 pm

    Makes customizing that much quicker.

    I did have one question though… Is it possible to link this module to a specific URL?

    Case in point. I have a java script generated from an outside source which I to import text to the site. This script gathers the content and places it to a postview. However this post view is outside the site.

    Figured it would be easier if I just had the script link to the Html Module.

    Anythoughts?

    Thanks

Leave a reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image