Skip to content

Instantly share code, notes, and snippets.

@ronnyhartenstein
Created March 6, 2015 20:51
Show Gist options
  • Save ronnyhartenstein/0e344335a332e135e966 to your computer and use it in GitHub Desktop.
Save ronnyhartenstein/0e344335a332e135e966 to your computer and use it in GitHub Desktop.
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