Jump to content

How to shorten category short description?


Recommended Posts

Prestashop 1.6.1.5
Is it possible to shorten the category short description text?
The visible text for category short description seems truncated to 350 characters,

In the product.tpl file I can replace 350 with 150, but that only affects when to display the "more" button and doesn't shorten the text.
{if Tools::strlen($category->description) > 150}

On the next line I tried this:
<div id="category_description_short" class="rte">{$description_short|truncate:150}</div>
But this change made the "more" button show no text at all.

Grateful for help. 

Link to comment
Share on other sites

If I manually truncate it, the "more" button will not display anything. I need a lot of stuff there, but only two lines or so in the short_description initially. That's the whole point and why I want to shorten the "short description.

I can not "remove that part" and let it show all the text, because the product list will be to far down, to hidden when customer visits the category.

Here is link: https://www.kunnskap.no/butikk/64-jeg-kan-regne-1-4

Appreciate all help.

 

Link to comment
Share on other sites

  • 2 years later...

In category.tpl (Prestashop 1.6.1.24) you can try to add style="height:20.5em;overflow:hidden;", you can modify the length of the text by line.

<div id="category_description_short" class="rte" style="height:20.5em;overflow:hidden;">{$category->description}</div>

 

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