Skip to content

Instantly share code, notes, and snippets.

@hesselberg
Last active January 16, 2017 22:41
Show Gist options
  • Save hesselberg/59679becb6360773e2b34302dde70463 to your computer and use it in GitHub Desktop.
Save hesselberg/59679becb6360773e2b34302dde70463 to your computer and use it in GitHub Desktop.
Shoporama recursive categories
<button>›</button>
<ul>
<{foreach from=$childcategories item="childcategory"}>
<{if $childcategory->getInMenu()}>
<li>
<a href="<{$childcategory->getUrl()|escape}>"><{$childcategory->getName()|escape}></a>
<{if $childcategory->getChildren()}>
<{include file="_getchildcategory.html" childcategories=$childcategory->getChildren()}>
<{/if}>
</li>
<{/if}>
<{/foreach}>
</ul>
<ul>
<{foreach from=$webshop->getCategories() item="category"}>
<{if $category->getInMenu()}>
<li>
<a href="<{$category->getUrl()|escape}>"><{$category->getName()|escape}></a>
<{if $category->getChildren()}>
<{include file="_getchildcategory.html" childcategories=$category->getChildren()}>
<{/if}>
</li>
<{/if}>
<{/foreach}>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment