Jump to content

[SOLVED] Left align the category image


Recommended Posts

Hi

Can someone tell me how to left align the category image please?

I have tried every variation of alignment I can think of in both Global CSS and category.tpl as HTML and nothing makes any difference, it stay stuck in the middle.

I'd very much appreciate any help

Thanks!

Link to comment
Share on other sites

Change lines 23-25 (in PrestaShop v1.3.2) of category.tpl in your theme's directory from:


   <img src="{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" />



to:

{**}
   <img src="{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" />
{**}

Link to comment
Share on other sites

  • 3 weeks later...

Thanks for your reply and my apologies for not responding sooner.

I have done as you suggested and unfortunately that doesn't seem to have fixed the problem

The image moves by about 1/4" to the left, but doesn't left align...

Any ideas on why that might be?

Many thanks for your help so far!

Link to comment
Share on other sites

Aha! I've answered my own question

When uploading an image, the category image that PrestaShop creates is 500 pixels wide white box with the product centered within, so its impossible to left align.

So that leads me to my next question, which is how can I change the default size of the category image that Presta creates?

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