Jump to content

Always display full category description


Recommended Posts

Hi !

I want to always display full category description. In default presta 1.6 theme category.tpl i foound a line

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

What I understand is that "More" Button will be displayed if description is longer than 350 characters.

I changed that to bigger value (like 99999) but nothing changed. And yes, Force theme files compilation in back office is on.

Link to comment
Share on other sites

  • 2 weeks later...

Ok, I figured it out myself.

Looking at line 91, 92 and 93 in category.tp

{if $subcategory.description}
<div class="cat_desc">{$subcategory.description}</div>
{/if}

I thought I'll do something like this with category description so i edited lines 59 to 65

{if Tools::strlen($category->description) > 350}
<div id="category_description_short" class="rte">{$description_short}</div>
 <div id="category_description_full" class="unvisible rte">{$category->description}</div>
<a href="{$link->getCategoryLink($category->id_category, $category->link_rewrite)|escape:'html':'UTF-8'}" class="lnk_more">{l s='More'}</a>
         {else}
       <div class="rte">{$category->description}</div>
   {/if}

And I have this. And it works ! I have full category description without MORE button

{if $category->description}
<div class="rte">{$category->description}</div>
{/if}
Edited by Jacob M (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...