Removing horizontal space in mosimage

When using the mambot {mosimage}, Joomla automatically puts a horizontal space (hspace) around your image. This can destroy a website layout, especially one that is specifically sized up to the last pixel.

An alternative, of course, is to just use the <img> tags in inserting images. However, this has a weakness: The paths are not dynamic. This means that if you need to move your Joomla installation to a different folder, you will need to find all instances of your tags, & replace them with your new path. This means that the mosimage mambot a distinct advantage.

To change mosimage’s hspace value to zero:

  1. Open /mambots/content/mosimage.php
  2. In approximately line 175, change

    hspace="6"
    to
    hspace="0"

Alternatively, you can simply just remove the hspace value all together.

Line 175 will thus look like this:

$image .=' alt="'. $attrib[2] .'" title="'. $attrib[2] .'" border="'. $border .'" />';


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *