Jump to content

Category image not resizing properly in mobile view.


Recommended Posts

Hello,

 

I have an active prestashop website and it has just come to my attention that, when viewing on mobile devices, the category images do not load correctly. For example, the smaller the display screen, the more the image moves to the left to the point where most of the image is off-screen. When viewing on a computer or laptop moniter the placement is fine.

 

It is not the category image thumbnail I am referring to, but the 'header' on the category screen.

 

Could anyone assist me in correcting this? Is this a known problem, I've spent hours searching the forums but have been unable to find a relevant page.

 

Kind regards

Ryan.

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

  • 7 months later...

Hello,

 

I couldn't get anywhere with it. However, the issue sorted itself out when I upgraded to the latest version of Prestashop a few weeks/months ago.

 

I'm really sorry I can't be of more help to you.

 

EDIT: Apparently 20163749 is another username of mine, I didn't realise I had more than one log-in!

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

  • 2 months later...

There is already a topic with the solution: https://www.prestashop.com/forums/topic/359149-solved-mobile-category-images/ but unfortunately the code didn't help me because it was showing the whole picture and the text was going out of it.

 

My solution was replacing in code the "right" with "left", so the zoom focuses on the left side (where my picture is blank and the text is visible).

 

If you want also to zoom to the left side of your category image, go to /themes/default-bootstrap/category.tpl and under content_scene_cat_bg replace the "right" style with "left". See the code below:

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'}) left center no-repeat; background-size:cover; min-height:{$categorySize.height}px;"{/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...