Jump to content

shortening the description of the category in prestashop 1.7


Ksawery88

Recommended Posts

hey, he wants to shorten the description of the category to 500 characters I want the read more button to appear


in the file /themes/classic/templates/catalog/listing/category.tpl is:
    

<h1 class="h1">{$category.name}</h1>
      {if $category.description}
        <div id="category-description" class="text-muted">{$category.description nofilter}</div>
      {/if}


In prestashop 1.6, read more is standard when the description is too large. How should I do this on prestashop 1.7?

Link to comment
Share on other sites

I don't know if it works in 1.7, but try this:

 <div id="category-description" class="text-muted">{$category.description|truncate:500 nofilter}</div>

I guess this will do the trick. However, in future releases of PrestaShop Smarty code will be eliminated.

Link to comment
Share on other sites

vor 17 Stunden schrieb  eleazar:

I don't know if it works in 1.7, but try this:


 <div id="category-description" class="text-muted">{$category.description|truncate:500 nofilter}</div>

I guess this will do the trick. However, in future releases of PrestaShop Smarty code will be eliminated.

It does not work. I mean, I have a long text and I want to shorten it. To make the read more button appear. Prestashop 1.6 is standard. How should I do this on prestashop 1.7?

text.jpg

Link to comment
Share on other sites

16 minutes ago,  eleazar said:

Sorry, my bad! I corrected my writing error. Try again. And if you don't want your text format to disappear, drop the parameter nofilter.


Yes, it shortens the description, but there is no read more button so that the user can read further content.

Link to comment
Share on other sites

  • 10 months later...
  • 1 year later...
  • 2 weeks later...

Bonjour,

 

C'est possible mais demande de modifier le thême classic d'origine:

- via CSS pour limiter l'affichage par défaut du bloc de la description  (propriétés "max-height" et "overflow")

- via javascript  d'avoir un bouton/lien qui change les propriétés CSS du bloc ci-dessus pour les désactiver

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