Jump to content

[Solved] Changing the category image size


Recommended Posts

Hi,

I'm trying to change the category image size:

Circles0 product

<!-- Category image -->



The image seems to be dynamically changed to 500px X 150px. Is there a way to 'override' this setting so that I can have the image size I want? I have been into the global.css and .tpl files so far and have not seen any way to do it,

any help appreciated,

cheers,

Wittner

Link to comment
Share on other sites

  • 2 years later...

To re-size subcategories images in prestashop 1.4 follow this instructions

1. Go to Back Office Preferences/Image and create new image with the desired size

2. Edit /themes/YOURTHEME/category.tpl subcategories section and change ALL MEDIUM instances

    getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}">
       {if $subcategory.id_image}
getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
       {else}

       {/if}



TO

    getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}">
       {if $subcategory.id_image}
getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'YOUR-NEW-IMAGE-NAME')}" alt="" width="{$YOUR-NEW-IMAGE-NAMESize.width}" height="{$YOUR-NEW-IMAGE-NAMESize.height}" />
       {else}

       {/if}
   



3. Edit /themes/YOURTHEME/css/category.css subcategories section and change

body#category #subcategories li { height: 136px; width: 108px; margin-right: 3px }



TO

body#category #subcategories li { height: NEW-SIZE-IN-PIXELSpx; width: NEW-SIZE-IN-PIXELSpx; margin-right: 3px }



The height should be higher then the actual image height in order to display the hyperlinks correctly

4. Edit /controlers/CategoryController.php go to section self::$smarty->assign(array(
and add

'YOUR-NEW-IMAGE-NAMESize' => Image::getSize('YOUR-NEW-IMAGE-NAME'),



adding this line will fix the problem of images not displayed in Internet Explorer

Link to comment
Share on other sites

  • 9 months later...
  • 1 month later...
×
×
  • Create New...