Jump to content

How to add "Show Less" option to category description pages


Recommended Posts

Currently, we are running an instance of Prestashop v1.6. Once the category description gets longer than 350 characters you have a "More" option popup which reveals the full category description, but then you have no option to collapse this back to the short description unless you refresh the page.  We would ideally love to see a "Less" or "Show Less" appear when it is being viewed as the full description.

 

How could we modify the category.tpl file or implement something to achieve this option?

 

Currently, the code in the category.tpl shows the following for the "More" option:

 

 {if Tools::strlen($category->description) > 350}


                                <div id="category_description_short">{$description_short}</div>


                                <div id="category_description_full" class="unvisible">{$category->description}</div>


                                <a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
Edited by PTID (see edit history)
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...