Jump to content

How to show description of category in front office


Recommended Posts

Hi

 

How can i see the category description in front office ... see attached image.

 

my category.tpl is

 

include file="$tpl_dir./breadcrumb.tpl"}
{include file="$tpl_dir./errors.tpl"}

{if isset($category)}
    {if $category->id AND $category->active}
        <h1>
            {strip}
                {$category->name|escape:'htmlall':'UTF-8'}
                {if isset($categoryNameComplement)}
                    {$categoryNameComplement|escape:'htmlall':'UTF-8'}
                {/if}
            {/strip}
        <span class="resumecat category-product-count">
            {include file="$tpl_dir./category-count.tpl"}
        </span>
        </h1>
                
        
        {if $scenes || $category->description || $category->id_image}
        <div class="content_scene_cat">
            {if $scenes}
                <!-- Scenes -->
                {include file="$tpl_dir./scenes.tpl" scenes=$scenes}
            {else}
                <!-- Category image -->
                {if $category->id_image}
                <div class="align_center">
                    <img src="{$link->getCatImageLink($category->link_rewrite, $category->id_image, 'category_default')}" alt="{$category->name|escape:'htmlall':'UTF-8'}" title="{$category->name|escape:'htmlall':'UTF-8'}" id="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" />
                </div>
                {/if}
            {/if}

            {if $category->description}
                <div class="cat_desc">
                {if strlen($category->description) > 120}
                    <p id="category_description_short">{$category->description|truncate:120}</p>
                    <p id="category_description_full" style="display:none">{$category->description}</p>
                    <a href="#" onclick="$('#category_description_short').hide(); $('#category_description_full').show(); $(this).hide(); return false;" class="lnk_more">{l s='More'}</a>
                {else}
                    <p>{$category->description}</p>
                {/if}
                </div>
            {/if}
        </div>
        {/if}
        {if isset($subcategories)}
        <!-- Subcategories -->
        <div id="subcategories">
            <h3>{l s='Subcategories'}</h3>
            <ul class="inline_list clearfix">
            {foreach from=$subcategories item=subcategory}
                <li>
                    <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}" class="img">
                        {if $subcategory.id_image}
                            <img src="{$link->getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium_category')}" alt="{$subcategory.name|escape:'htmlall':'UTF-8'}"  />
                        {else}
                            <img src="{$img_cat_dir}default-medium_category.jpg" alt="{$subcategory.name|escape:'htmlall':'UTF-8'}"/>
                        {/if}
                    </a>
                    {*<a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" class="cat_name">{$subcategory.name|escape:'htmlall':'UTF-8'}</a>
                    {if $subcategory.description}
                        <p class="cat_desc">{$subcategory.description}</p>
                    {/if}*}
                </li>
            {/foreach}
            </ul>
            <br class="clear"/>
        </div>
        {/if}

        {if $products}
            <div class="content_sortPagiBar">
                {*{include file="$tpl_dir./pagination.tpl"}*}
                <div class="sortPagiBar clearfix">
                    {include file="./product-sort.tpl"}
                    {include file="./product-compare.tpl"}
                    {*{include file="./nbr-product-page.tpl"}*}
                </div>
            </div>
            
            {include file="./product-list.tpl" products=$products}
            
            <div class="content_sortPagiBar">
                <div class="sortPagiBar clearfix">
                    {include file="./pagination.tpl"}
                    {*{include file="./product-sort.tpl"}*}
                    {include file="./product-compare.tpl"}
                    {*{include file="./nbr-product-page.tpl"}*}
                </div>

            </div>
        {/if}
    {elseif $category->id}
        <p class="warning">{l s='This category is currently unavailable.'}</p>
    {/if}
{/if}

post-734452-0-02742600-1386531008_thumb.jpg

Link to comment
Share on other sites

you've got proper code there:

{if $category->description}
                <div class="cat_desc">
                {if strlen($category->description) > 120}
                    <p id="category_description_short">{$category->description|truncate:120}</p>
                    <p id="category_description_full" style="display:none">{$category->description}</p>
                    <a href="#" onclick="$('#category_description_short').hide(); $('#category_description_full').show(); $(this).hide(); return false;" class="lnk_more">{l s='More'}</a>
                {else}
                    <p>{$category->description}</p>
                {/if}
                </div>
            {/if}
        </div>
        {/if}
Link to comment
Share on other sites

Hi Vekia

 

I found another way to do it,, i think what i was trying is apparently not the way Prestashop  works,, maybe i had joomla in my mind :-)

 

I have another small issue perhaps you can guide. Pls. see attached screenshot.

 

1. Even i have choosen Danish language the site still says "Cart" and not the danish word... from where can i change this

 

2. How can I change the text of the contact form boxes

 

Hope you can guide. and thanks

post-734452-0-85389000-1386577634_thumb.jpg

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

may i know where the problem was?

 

1) localization > translations, then from first dropdown select "installed modules translations", select theme, click on you language flag and you will see page where you will be able to translate this text.

2) What you want to change? color? styles? maybe text? if text - the same as above, but from first dropdown select "front office translatins"

Link to comment
Share on other sites

i was trying to make article on top menu,, but looks like i have to make first a categoy and than an article and show the article "button" via cms.   But i still find it strange that the descripion of the category is not shown when clicked. :-)

 

I tried the translation and get the following 

Warning! Your PHP configuration limits the maximum number of fields allowed in a form 1000 for max_input_vars.
Please ask your hosting provider to increase the this limit to 1441 at least or edit the translation file manually.

 

I have already tried the php.ini instructions to try increase max_input_vars given in another topic.

Link to comment
Share on other sites

i was trying to make article on top menu,, but looks like i have to make first a categoy and than an article and show the article "button" via cms.   But i still find it strange that the descripion of the category is not shown when clicked. :-)

 

I tried the translation and get the following 

Warning! Your PHP configuration limits the maximum number of fields allowed in a form 1000 for max_input_vars.

Please ask your hosting provider to increase the this limit to 1441 at least or edit the translation file manually.

 

I have already tried the php.ini instructions to try increase max_input_vars given in another topic.

 

in this case it will be much easier if you will ask your hosting probider about this. I don't know your host configuration, maybe you haven't got rights to increase this limit

Link to comment
Share on other sites

Hi

 

It is really strange, the service provided changed the max_input_vars. to 10000.

 

But now i can not access the site... only i can access the admin back end af before,, but front end is not loading get this message... and i did not do ANYTHING... it is working fine ,,,, and now ??? strange

 

Error 404: File Not Found

The requested page is not found. This may happen due to the following reasons:

Please contact your webmaster if you are not sure what goes wrong.

Link to comment
Share on other sites

×
×
  • Create New...