Jump to content

Subcategory List


Recommended Posts

We have a category with some subcategories. When you click on the category, the template generates a list of the subcategories with images. As soon as you click on a subcategory, the list disappears. I would like to program the template in a way that within a subcategory, the list shows the subcategories of the parent category.

How do I achieve that? The subcategories list is generated with the following code. I would have to extend this code and do something like

{if isset($parentcategory has $subcategories)} {foreach subcategory of parentcategory} getimage getcategorylink blabla



Does someone know how to do this??


Here's the current code:

{if isset($subcategories)}
       <!-- Subcategories -->

{l s='Subcategories'}

           {foreach from=$subcategories item=subcategory}

getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{$subcategory.name|escape:'htmlall':'UTF-8'}">
                       {if $subcategory.id_image}
getCatImageLink($subcategory.link_rewrite, $subcategory.id_image, 'medium')}" alt="" width="{$mediumSize.width}" height="{$mediumSize.height}" />
                       {else}

                       {/if}


getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}">{$subcategory.name|escape:'htmlall':'UTF-8'}

           {/foreach}




       {/if}

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks 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...