Jump to content

[SOLVED] how to resize image of subcategories


Recommended Posts

As you can see in the pic. I have grid view subcategories 4 in a row,

but i would like to have larger image size, the size is only 58x58px and i would

like it to be bigger and still have 4 in row.

 

Can anyone help me with this problem. ?

 

post-737469-0-89785800-1393022777_thumb.jpg

Link to comment
Share on other sites

if i were you i will create new imagetype (under preferences > images tab in bo)

name it as, for example, medium-category-default and use it only for categories

then regenerate thumbs for this new imagetype.

 

 

then go to category.tpl and change medium_default to medium-category-default in imatype definition code

 

then it will not affect other pictures.

Link to comment
Share on other sites

if i were you i will create new imagetype (under preferences > images tab in bo)

name it as, for example, medium-category-default and use it only for categories

then regenerate thumbs for this new imagetype.

 

 

then go to category.tpl and change medium_default to medium-category-default in imatype definition code

 

then it will not affect other pictures.

It does not work, maybe I am doing something wrong. 

 

I have made the new imagetype and regenerate thumbs.

 

Then I change category.tpl from this:

 

{if isset($subcategories)}
<!-- Subcategories -->
<div id="subcategories">
<h3>{l s='Subcategories'}</h3>
<ul class="inline_list">
{foreach from=$subcategories item=subcategory}
<li class="clearfix">
<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}" class="img">
{if $subcategory.id_image}
                            <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html'}" alt="{if $subcategory.description}{$subcategory.description}{/if}" width="{$mediumSize.width}" height="{$mediumSize.height}" />
                        {else}
                            <img src="{$img_cat_dir}default-medium_default.jpg" alt="{if $subcategory.description}{$subcategory.description}{/if}" width="{$mediumSize.width}" height="{$mediumSize.height}" />
                        {/if}
</a>
<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" class="cat_name">{$subcategory.name|escape:'htmlall':'UTF-8'}</a>
  {*
{if $subcategory.description}
<p class="cat_desc">{$subcategory.description}</p>
{/if}
   *}
</li>
{/foreach}
</ul>
<br class="clear"/>
</div>
{/if}
 
TO THIS
 
{if isset($subcategories)}
<!-- Subcategories -->
<div id="subcategories">
<h3>{l s='Subcategories'}</h3>
<ul class="inline_list">
{foreach from=$subcategories item=subcategory}
<li class="clearfix">
<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}" class="img">
{if $subcategory.id_image}
                            <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium-category-default')|escape:'html'}" alt="{if $subcategory.description}{$subcategory.description}{/if}" width="{$mediumSize.width}" height="{$mediumSize.height}" />
                        {else}
                            <img src="{$img_cat_dir}default-medium-category-default.jpg" alt="{if $subcategory.description}{$subcategory.description}{/if}" width="{$mediumSize.width}" height="{$mediumSize.height}" />
                        {/if}
</a>
<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" class="cat_name">{$subcategory.name|escape:'htmlall':'UTF-8'}</a>
  {*
{if $subcategory.description}
<p class="cat_desc">{$subcategory.description}</p>
{/if}
   *}
</li>
{/foreach}
</ul>
<br class="clear"/>
</div>
{/if}
 
But the subcategory images does not get any bigger, did I do something wrong ?
 
Link after I made the changes   
 
 
Link to comment
Share on other sites

your shop now uses correct images (natural size: 110px x 110px)

http://www.lm-scootershop.dk/c/154-medium-category-default/blaeserskjold.jpg

 

but the problem is with width="" and height="" params for <img> tag

quick solution:

<img src="{$img_cat_dir}default-medium-category-default.jpg" alt="{if $subcategory.description}{$subcategory.description}{/if}" width="{$mediumSize.width}" height="{$mediumSize.height}" />

to

<img src="{$img_cat_dir}default-medium-category-default.jpg" alt="{if $subcategory.description}{$subcategory.description}{/if}" width="110" height="110" />
Link to comment
Share on other sites

 

your shop now uses correct images (natural size: 110px x 110px)

http://www.lm-scootershop.dk/c/154-medium-category-default/blaeserskjold.jpg

 

but the problem is with width="" and height="" params for <img> tag

quick solution:

<img src="{$img_cat_dir}default-medium-category-default.jpg" alt="{if $subcategory.description}{$subcategory.description}{/if}" width="{$mediumSize.width}" height="{$mediumSize.height}" />

to

<img src="{$img_cat_dir}default-medium-category-default.jpg" alt="{if $subcategory.description}{$subcategory.description}{/if}" width="110" height="110" />

You are the man, Thank you very much :)

Link to comment
Share on other sites

×
×
  • Create New...