Ksawery88 Posted April 4, 2019 Share Posted April 4, 2019 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 More sharing options...
eleazar Posted April 4, 2019 Share Posted April 4, 2019 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 More sharing options...
Ksawery88 Posted April 5, 2019 Author Share Posted April 5, 2019 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? Link to comment Share on other sites More sharing options...
eleazar Posted April 5, 2019 Share Posted April 5, 2019 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. Link to comment Share on other sites More sharing options...
Ksawery88 Posted April 5, 2019 Author Share Posted April 5, 2019 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 More sharing options...
kos2 Posted February 27, 2020 Share Posted February 27, 2020 this does not work. the read more link is not shown ... Link to comment Share on other sites More sharing options...
SalDan Posted April 19, 2021 Share Posted April 19, 2021 ciao a tutti novità riguardo questa funzione ...qualcuno che mi aiuta grazie Link to comment Share on other sites More sharing options...
popolon Posted May 4, 2021 Share Posted May 4, 2021 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 More sharing options...
JBW Posted May 6, 2021 Share Posted May 6, 2021 On 4/19/2021 at 3:55 PM, SalDan said: ciao a tutti novità riguardo questa funzione ...qualcuno che mi aiuta grazie Ciao, please check out my module "Expandable descriptions- "read more..." in your texts": https://addons.prestashop.com/en/product.php?id_product=49795 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now