Jump to content

How to Change Image Size of SUBcategories ?


Recommended Posts

Greetings,

 

How do I change the image size of the subcategories from the medium (80px × 80px) to something larger and easier to view? Here is what I have tried so far, based on information that I found at other posts on this forum:

  1. I created a new picture type called "SubCat" under preferences>Images
  2. I Regenerated thumbnails
  3. I went to my server and changed the category.tpl file, wherever there was a entry that said 'medium' in association to 'Subcategories,' I changed the value to 'SubCat.'

Nothing changed. I even cleared my browser caches and tried on IE, Firefox, and Google Chrome.

 

Still- Nothing changed (so I changed everything back to the original values)

 

Here is the example of the problem and also please note that the text does not wrap properly around the 80px × 80px images (which are just too small): http://www.carriedaw.../5-bath-fizzies

 

It would seem to me that there should be an easy, back office, way of changing the size of these images... but apparently, there is not.

 

Can you help me?

Thanks

Link to comment
Share on other sites

Hi,

 

change also controllers/CategoryController.php file on line 133 - here you must add your new picture type:

 

self::$smarty->assign(array(
 'products' => (isset($this->cat_products) AND $this->cat_products) ? $this->cat_products : NULL,
 'id_category' => (int)($this->category->id),
 'id_category_parent' => (int)($this->category->id_parent),
 'return_category_name' => Tools::safeOutput($this->category->name),
 'path' => Tools::getPath((int)($this->category->id)),
 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
 'categorySize' => Image::getSize('category'),
 'mediumSize' => Image::getSize('medium'),
 'thumbSceneSize' => Image::getSize('thumb_scene'),
 'homeSize' => Image::getSize('home'),

 'SubCat' => Image::getSize('SubCat')

   ));

Link to comment
Share on other sites

Thanks! That seems to have worked (though I need to fix my actual images). But where did the text go that describes each subcategory?).

 

FOLLOW UP: It seems that I spoke too soon. This is NOT a solution to this problem. For some reason, when I tried to make the SubCat images smaller than the 300x300 pixels (which seemed, momentarily, to be working), my images disappeared and I could not get them back.

 

I am going to try to UNdo all of the changes made and try to repost this problem on one of the other boards as it seems to be more of a 'coding' problem than it does a simple 'configuration' problem.

Link to comment
Share on other sites

  • 4 months later...

<div id="subcategories">

<h3>{l s='Subcategories'}</h3>

<ul class="list">

{foreach from=$subcategories item=subcategory}

<li>

<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}">

{if $subcategory.id_image}

<img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'Subcat')}" alt="" width="{$SubcatSize.width}" height="{$SubcatSize.height}" />

{else}

<img src="{$img_cat_dir}default-Subcat.jpg" alt="" width="{$SubcatSize.width}" height="{$SubcatSize.height}" />

{/if}

</a>

<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'}</a>

</li>

{/foreach}

</ul>

Edited by mobilafitness (see edit history)
Link to comment
Share on other sites

  • 1 year later...

Have you just changed this part of the code or something else beside that?

 

I'm asking, because it doesn't work for me  <_<

 

<div id="subcategories">
<h3>{l s='Subcategories'}</h3>
<ul class="list">
{foreach from=$subcategories item=subcategory}
<li>
<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}">
{if $subcategory.id_image}
<img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'Subcat')}" alt="" width="{$SubcatSize.width}" height="{$SubcatSize.height}" />
{else}
<img src="{$img_cat_dir}default-Subcat.jpg" alt="" width="{$SubcatSize.width}" height="{$SubcatSize.height}" />
{/if}
</a>
<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'}</a>
</li>
{/foreach}
</ul>

Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...