Jump to content

[Solved] How do i unhide category description?


Recommended Posts

A year or so ago I decided to hide the category description text. Now i want to unhide it, but I forgot how i have hidden it. Can someone help me with this?

 

Edit: this code worked for me

{if $category->description}
<div class="cat_desc rte">
{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>
{else}
<div>{$category->description}</div>
{/if}
</div>
{/if}

Edited by animuz1 (see edit history)
Link to comment
Share on other sites

That would be in your theme's category.tpl file. Add this code wherever you want the description, by default inside the "{if $scenes || $category->description || $category->id_image}" block:

{if $category->description}
	<div class="cat_desc">
		<p>{$category->description}</p>
		<a href="#" class="lnk_more">{l s='More'}</a>
	</div>
{/if}
Link to comment
Share on other sites

I found a post on the forum that did exactly what i wanted:

 

Pasted this in my category.tpl:

{if $category->description}
<div class="cat_desc rte">
{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>
{else}
<div>{$category->description}</div>
{/if}
</div>
{/if}

 

 

Fire2, thank you so much for your help!

Edited by animuz1 (see edit history)
Link to comment
Share on other sites

You would have to change the code you inserted:

{if $category->description}
  <div class="cat_desc rte">
    {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>
    {else}
      <div>{$category->description}</div>
    {/if}
  </div>
{/if}

to this:

{if $category->description}
  <div class="cat_desc rte">
      <div>{$category->description}</div>
  </div>
{/if}
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...