• Priority: 0
  • Status: Closed
  • Theme: Alysum
  • Assigned To: Fred
  • Private: No
  • Open Date: 14.10.20, 21:54
  • Opened by: Corentin POSTIC
  • Closed by: Fred
  • Closed on: 09.11.20, 16:30
  • Reason: Closed
  • Comment: Glad to help!

Ticket #19451 - Read more button category description

Hello,

I need to add a “Read more” button and show only the X first words/letters of the description of my categories because they are way too long otherwise.
Is there a way to do that ? Should I edit the code ? Where ?

Thanks a lot

Comments

Fred 15 Oct 2020, 10:14

Hi, Corentin POSTIC.
You need the file /themes/alysum/templates/catalog/listing/category.tpl you can find category description there.
You can cut the description in this way

{$category.description|truncate:100:'...' nofilter}
Corentin POSTIC 15 Oct 2020, 10:38

Thanks for your quick answer, but if I truncate it, there is no way for the user to see the whole description, for example by clicking on a Read more button ?

Fred 15 Oct 2020, 11:20

I gave you a path to the file, you can modify it as you need