Jump to content

How to define what image is used for category list vs. main header image


Yves

Recommended Posts

Hi there,

Maybe the answer is simple for my next question - please see attachment to illustrate:


Every category has 2 totally different images (if you want) you can upload in the backoffice: main image and thumb image.
- In my situation the "category list" is showing the "main image" with the category_default size, resized by css.
- The header image (title) of a category page is the same main image and also category_default size, resized by css.
=> I would like to show the"thumb image" (not the main image) in the category list. "Where" can I change "what picture" ("normal" or "_thumb image") is applied in the category "list"? And where can I define "what picture" ("normal" or "_thumb image") is applied in the "header" of the category? I want to change the small category images (in the list) to be "small_default" with the thumb image. The category main image can stay like it is "category_default".
Do I have to change the tpl file? What file? Or is there a better way to define that?

Thanks in advance!

Schermafbeelding 2019-02-06 om 22.26.23.png

Link to comment
Share on other sites

I found it...

editing [root]\themes\[my_theme]\templates\catalog\listing\category.tpl

<img class="img-fluid" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'category_default')}" alt="{$subcategory.name|escape:'html':'UTF-8'}"/>

change into:

<img class="img-fluid" src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'small_default')}" alt="{$subcategory.name|escape:'html':'UTF-8'}"/>

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

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...