Lukasz.wroclaw Posted March 25, 2015 Share Posted March 25, 2015 For 1.6.0.14, is there a way to change short description to in category for longer text, for example 650?I have multistore, and changed a category.tpl in my basic theme: {if $category->description} <div class="cat-desc rte"> {if Tools::strlen($category->description) > 650} <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> {else} <div>{$category->description}</div> {/if} </div> {/if} but without any result. Thank you for any ideas... Luk Link to comment Share on other sites More sharing options...
Sniper Zone Posted May 12, 2015 Share Posted May 12, 2015 It count the html tags. Maybe you have a longer description than 650 because of html tags. Link to comment Share on other sites More sharing options...
EWinchester Posted September 9, 2017 Share Posted September 9, 2017 (edited) you need to replace: {if Tools::strlen($category->description) > 350} <div id="category_description_short">{$description_short}</div> with: {if Tools::strlen($category->description) > 800} <div id="category_description_short">{$category->description|truncate:800:'...'}</div> There are 2 different locations on the page with this code so you may need to try one or the other. Edited September 9, 2017 by EWinchester (see edit history) 1 Link to comment Share on other sites More sharing options...
Recommended Posts