Skip to content

Tag: image

How to add a scallable background image to your site?

If you want to add an image that resizes according to the monitor or the browser size just follow the steps:

First put the image exactly after the opening <body> tag:

<body>

<img src=”images/bg.jpg” class=”bg” />

Then go to the CSS and add this:


img.bg {
     bottom:0;
     min-width:1024px;
     position:fixed;
     right:0;
     width:100%;
}

Then add some exception CSS for IE6, because it doesn’t get this stuff to work well.

How to add additional field for an image in Joomla VirtueMart Manufacturer page?

Steps:

1. Open phpMyAdmin and add the additional field to the jos_vm_manufacturer:

ALTER TABLE `jos_vm_manufacturer` ADD `mf_image` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER `mf_desc`

2. Open manufacturer.manufacturer_form.php and add additional row for the new field:

<tr>
<td width="22%" align="right"  valign="top"><br/><br/>Image:</td>
<td width="78%" ><br/><br/><?php
editorArea( 'editor2', $db->f("mf_image"), 'mf_image', '300', '150', '70', '25' )
?></td>
</tr>

3. Open ps_manufacturer.php and add the new field to the add and update functions the same way like the field mf_desc is added (just copy the line and add a new row after but for mf_image)

4. Open shop.manufacturer_page.php and do the same like in the previous step also don’t forget to add mf_image in the select statement for the database

5. If needed add the new field in the shop.manufacturer.tpl.php

6. Open shop.browse.php and add:

$browsepage_lbltext = $db->f("mf_image");
$tpl->set( 'browsepage_lblimage', $browsepage_lblimage );

After:

$browsepage_lbltext = $db->f("mf_desc");
$tpl->set( 'browsepage_lbltext', $browsepage_lbltext );

Also here don’t forget to add the mf_image into the select statement above.

7. Then edit the browse_header_manufacturer.tpl.php add a field like $browsepage_lbltext but for the image

This is it…