Jump to content

Question about sub-categories images


Recommended Posts

Hello,

 

I have created a main category and listed sub-categories (each with its own image)  under it - see snapshot below:

 

category.jpg

 

Now when I access a sub-category, the image featured at the top is the same as the one featured on the main category page  - see snapshot below:

 

sub-category.jpg

 

Is there any way to have each sub-category comes with either just a text, or a long image that fits nicely at the top?

 

Cheers!

Link to comment
Share on other sites

Unfortunately this is something "normal" for PrestaShop, there is no thumbnail and lead image for categories, of course there is workaround for this, for example you can upload wider images directly to for example /img/cat_wide/ID_CATEGORY.jpg and change category.tpl file to display {$img_ps_dir}cat_wide/{$category->id_category}.jpg, to do it you need to change this:

<div class="content_scene_cat_bg"{if $category->id_image} style="background:url({$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')|escape:'html':'UTF-8'}) right center no-repeat; background-size:cover; min-height:{$categorySize.height}px;"{/if}>

to this:

<div class="content_scene_cat_bg"{if $category->id_image} style="background:url({$img_ps_dir}cat_wide/{$category->id_category}.jpg) right center no-repeat; background-size:cover; min-height:HEIGHT_OF_YOUR_IMAGEpx;"{/if}>
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...