Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
OXID Bootstrap Responsive: meinshop/tpl/widget/categorytree.tpl
[{if $oxcmp_categories }]
[{assign var="categories" value=$oxcmp_categories->getClickRoot() }]
[{assign var="act" value=$oxcmp_categories->getClickCat() }]
[{if $categories }]
[{assign var="deepLevel" value=$oView->getDeepLevel()}]
<div class="list-group">
[{defun name="tree" categories=$categories}]
[{assign var="deepLevel" value=$deepLevel+1}]
[{assign var="oContentCat" value=$oView->getContentCategory() }]
[{foreach from=$categories item=_cat}]
[{if $_cat->getIsVisible() }]
[{* CMS category *}]
[{if $_cat->getContentCats() && $deepLevel > 1 }]
[{foreach from=$_cat->getContentCats() item=_oCont}]
<a class="list-group-item[{if $oContentCat && $oContentCat->getId()==$_oCont->getId() }] active [{else}] end [{/if}]" href="[{$_oCont->getLink()}]"><i></i>[{ $_oCont->oxcontents__oxtitle->value }]</a>
[{/foreach}]
[{/if }]
[{* subcategories *}]
<a class="list-group-item[{if $deepLevel == 1}] active[{/if}]" href="[{$_cat->getLink()}]">
[{ if $oView->showCategoryArticlesCount() && ($_cat->getNrOfArticles() > 0) }]
<span class="badge">[{$_cat->getNrOfArticles()}]</span>
[{/if}]
[{$_cat->oxcategories__oxtitle->value}]
</a>
[{if $_cat->getSubCats() && $_cat->expanded}]
<div class="list-group">
[{fun name="tree" categories=$_cat->getSubCats() }]
</div>
[{/if}]
[{/if}]
[{/foreach}]
[{/defun}]
</div>
[{/if}]
[{/if}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment