Jump to content

[SOLVED] Category image question


Recommended Posts

I am configuring the images for the categories.

I would like the image in the main category to show.
But not in the following.

for instance:

Menu is: +Boys
- Sweater (submenu item)
- jeans (submenu item)

When i click boys, i see a main image of boys and the smaller images from the subcategories sweater and jeans.
when i click on sweater, the smaller image of sweater becomes the main image. I do not want to show this main image in this subcategory.

How can i edit this? Because they are both categoryImage. If i delete this from category.tpl, I also delete the main image from boys....
(see topic http://www.prestashop.com/forums/viewthread/63763/configuring___using_prestashop/solvedcatagory_images_question_dot_)

Anyone here who might be able to help me out?

Link to comment
Share on other sites



Menu is: +Boys
- Sweater (submenu item)
- jeans (submenu item)

When i click boys, i see a main image of boys and the smaller images from the subcategories sweater and jeans.
when i click on sweater, the smaller image of sweater becomes the main image. I do not want to show this main image in this subcategory.

{if $category->id_image && $category->level_depth == 1}

Link to comment
Share on other sites

For people like me who aren't as handy as prhasespot with coding.

This way you can also add a class to your h2 in the subcategory.

Change:

        {strip}
       {$category->name|escape:'htmlall':'UTF-8'}

           {if $nb_products == 0}{l s='There are no products.'}
           {else}
               {if $nb_products == 1}{l s='There is'}{else}{l s='There are'}{/if} 
               {$nb_products} 
               {if $nb_products == 1}{l s='product.'}{else}{l s='products.'}{/if}
           {/if}
{/strip}



To:

            {if $category->name && $category->level_depth == 1} 
{strip}
       {$category->name|escape:'htmlall':'UTF-8'}

           {if $nb_products == 0}{l s='There are no products.'}
           {else}
               {if $nb_products == 1}{l s='There is'}{else}{l s='There are'}{/if} 
               {$nb_products} 
               {if $nb_products == 1}{l s='product.'}{else}{l s='products.'}{/if}
           {/if}
{/strip}

       {/if}



And add the following to change the h2 class in the subcat:

                    {if $category->name && $category->level_depth == 2} 
{strip}
       {$category->name|escape:'htmlall':'UTF-8'}

           {if $nb_products == 0}{l s='There are no products.'}
           {else}
               {if $nb_products == 1}{l s='There is'}{else}{l s='There are'}{/if} 
               {$nb_products} 
               {if $nb_products == 1}{l s='product.'}{else}{l s='products.'}{/if}
           {/if}
{/strip}

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