Jump to content

Read more in the category of how to do this in version 1.7?


mario_xp

Recommended Posts

I wanted to make a version of the category description from read more, unfortunately when I do it in the following way it does not recognize html tags

{if $category.description}
{if strlen($category.description) > 300}
<p class="cat_desc bordercolor bgcolor" id="category_description_short">{$category.description|truncate:300} <a href="#" onclick="$('#category_description_short').hide(); 
$('#category_description_full').show(); $(this).hide(); return false;" class="lnk_more">{l s='... More'}</a></p>
<p class="cat_desc bordercolor bgcolor" id="category_description_full" style="display:none">{$category.description}</p>
{else}
<p class="cat_desc bordercolor bgcolor">{$category.description }</p>
{/if}
{/if}

image.thumb.png.83b16c02023c91995e93e7ad900fc050.png

If I add "nofilter" to the code it gets even worse

{if $category.description}
{if strlen($category.description) > 300}
<p class="cat_desc bordercolor bgcolor" id="category_description_short">{$category.description|truncate:300 nofilter} <a href="#" onclick="$('#category_description_short').hide(); 
$('#category_description_full').show(); $(this).hide(); return false;" class="lnk_more">{l s='... More'}</a></p>
<p class="cat_desc bordercolor bgcolor" id="category_description_full" style="display:none">{$category.description nofilter}</p>
{else}
<p class="cat_desc bordercolor bgcolor">{$category.description nofilter}</p>
{/if}
{/if}

image.thumb.png.81ead290bfabe038205f86b9c691b2c8.png

Because "read more" does not work properly, how can I do that there is no problem with the html encoding and the short version appears correctly?

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...