Friday, December 20, 2013

How to change categories images dimensions in VirtueMart

To follow the steps  below you will need to use Firefox and its Firebug plugin.


    1. On  your site, open the page  where the category images are displayed (for instance, a sub-category page).virtuemart_category_images_resizing_1

    2. Click the Firebug icon at the top right of your  browser.

    3. In the panel that will appear below, will click  on “Click an element in the page to inspect”.

virtuemart_category_images_resizing_2


    1. With this tool selected, click on your category image (make sure that the image frame is highlighted)

virtuemart_category_images_resizing_3


    1. In this case, under the Styles you will see the part of your .css file with the width property that you will need to edit. For instance:


.category-view .spacer h2 a img 
height: auto;
margin-top: 0 !important;
width: 130px;

 



    1. Try adjusting the width in Firebug to get the value you can apply to the actual .css file afterwards. For instance, in our case we have 4 images in a row and since we need 5, the category images should be smaller.virtuemart_category_images_resizing_4

      So we are going to change the with to this



.category-view .spacer h2 a img {
height: auto;
margin-top: 0 !important;
width: 56px;

 



    1. When you are satisfied with the result, right click on the .css file name (in our case it’s virtuemart.css) and select Copy Location.

virtuemart_category_images_resizing_5


    1. Then paste the location somewhere  to see where your .css file is located on FTP. In our case  the location is templates/theme380/css/virtuemart.css

    2. Connect to your FTP using your  File manager or an FTP client (FileZilla).

    3. Navigate to the location of the .css file and open the file to edit.

    4. Look for the same you made changes to in Firebug (to see the lines, you can just copy the content of the file to Notepad++, Dreamweaver etc).

    5. Copy the line from Firebug and replace the corresponding in .css.virtuemart_category_images_resizing_6

      Save the changes.


    6. Refresh the sub-category page in your browser. You have done everything correctly, the result should be the same as in Firebug.

    7. Now, when the category images are re-sized, you may need to re-size their frames to eliminate the space around the images. Using Firebug, select the image frame.virtuemart_category_images_resizing_7

      Under Style you will find the width value responsible for the frame in the same .css file, for instance



.category-view .spacer, .category-view .category {
margin: 0 0 0 10px;
padding: 0 !important;
width: 175px;

 



  1. Change the frame size the same way the category image size was changed and re-fresh the browser window to see the changes.


How to change categories images dimensions in VirtueMart

No comments:

Post a Comment