Jump to content

Show category description and image ONLY on first product page ( prestashop v. 1.5-1.6)


Recommended Posts

Hi everyone,

 

I  want to have the category description and image show up on the first page of the category only, and not to repeat on all subsequent pages.

 

I've just found the solution for my question but it seems to work only for prestashop 1.3 version.

 

Here is it: http://www.prestashop.com/forums/topic/119271-solved-category-description-and-image-on-first-page-only/

 

Can anyone help with solution for 1.5-1.6 version ?

 

Thank you in advance.

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

Hi, Vekia.

 

Thank you very much for your fast response.

 

Yes, layered navigation block is enabled. Should it be not or should I change anything in its configuration ?

 

Currently, I have this in my category.tpl and I attached layered navigation block configuration.

 

{if $scenes}
<!-- Scenes -->
{include file="$tpl_dir./scenes.tpl" scenes=$scenes}
 
{else}
<!-- Category image -->
{if $category->id_image}
<div class="align_center category_image ">
<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"  />
</div>
{/if}
 
{/if}
        {if $category->description}
{if strlen($category->description) > 5000}
<p class="cat_desc clearfix" id="category_description_short">{$category->description|truncate:5000} <span onclick="$('#category_description_short').hide(); $('#category_description_full').show();" class="lnk_more_cat"><i class="icon-plus-sign"></i> {l s='More'}</span></p>
<p class="cat_desc clearfix" id="category_description_full" style="display:none">{$category->description}<span onclick="$('#category_description_short').show(); $('#category_description_full').hide();" class="lnk_more_cat close_cat"><i class="icon-minus-sign"></i> {l s='Hide'}</span></p>
{else}
<p class="cat_desc clearfix">{$category->description}</p>
{/if}
        
            {/if}
 
Link to comment
Share on other sites

okay, so with layered navigation block it's a bit complicated

cotnents with layered navigation block are loaded dynamically without page refresh, so in fact, each "page" is loaded not as a "new" page, but only contents of center block are reloaded.

Link to comment
Share on other sites

when I eliminate {if $scenes} from that code and add {if ($p==1) ||$p==''}, category image disappears in the first page , but appears again on all other product pages. Category description still remains on all pages .

 

Don't know what to do to force it to show category image and description only on first page as a sort of intro.

Link to comment
Share on other sites

  • 2 months later...
  • 1 year later...

Hi everyone,

 

I  want to have the category description and image show up on the first page of the category only, and not to repeat on all subsequent pages.

 

help with solution for 1.5 version with layered navigation block

 

This {if ($p==1) ||$p==''} and this link: http://www.prestasho...только-на-перв/ dont work. 

 

Can anyone help?

 

Thank you in advance.

Link to comment
Share on other sites

  • 6 months later...
  • 4 months later...
  • 7 months later...
  • 1 month later...

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