Jump to content

[SOLVED] New Picture problem.. Tumbnails not showing right.


Recommended Posts

Hi there people.

 

Have a little problem.

I had some problems making the pictures in subcategories show right.

Was as they where not scaling right.

I got the advice to scale the picture, and change the medium default settings under "pictures" in BO.

The right scale was 58 x 200px.

And this seemed to fix the problem. (See pic 2 and 3)

 

But...then i noticed it had messed up the thumblist under the product pic. (See Pic 1)

 

Any ides.... Hope so...

 

Regards.

 

Lasse 

Link to comment
Share on other sites

you have to create separate image for your categories.

go to preferences > images and create new category image, for exaple newCatImage and assign it only to categories.

put back settings for medium_default to original  (58x58)

 

after that regenerate thumbnails.

 

 

now go to category.tpl file and change medium_default imagetype to your new image, just use newCatImage instead of medium_default

 

voila ;)

Link to comment
Share on other sites

Hi Vekia.

 

Tried it. worked fine on the tunbnails.

But it messed up the subcategory images, and turned them back to 58x58 px

 

<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, 'Newcatimage')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{else}
<img src="{$img_cat_dir}default-medium_default.jpg" alt="" 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} 

 

 

Link to comment
Share on other sites

have you changed the code in category.tpl?

{if $subcategory.id_image}
    <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_default')|escape:'html'}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
    {else}
	<img src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{/if}

Change medium_default to your new image size name

Link to comment
Share on other sites

Hi Dioniz.

Think i have only changed it one place in the Category.tpl

 

Here is what mine looks like:

 

{if $subcategory.id_image}
<img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'Newcatimage')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
{else}
<img src="{$img_cat_dir}default-medium_default.jpg" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
Link to comment
Share on other sites

it's because of controller

there is a code like:

'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),

(controllers/front/CategoryController.php)

you have to change controller, or include height and width param instead of variable {mediumSize}

Link to comment
Share on other sites

if you want to modify controller use your new imagetype name instead of "medium"

if you don't want to modify controllers - change .tpl file

 

instead of

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

use

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

where the 200 and 50 is a size of your new imagetype

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...