Hi zusammen,
ich versuche aktuell eine Art Megamenu umzusetzen.
Dabei läuft soweit alles ganz gut, aber leider schaffe ich es nicht, mir alle Ebenen der Navigation auszugeben.
Tiefer als bis auf die zweite Kategorie komme ich nicht.
Hier mein Code:
[{oxscript include="js/jquery.menu-aim.js"}]
[{oxscript include="js/jquery.menu-aim.init.js"}]
[{assign var="oxcmp_categories" value=$oxcmp_categories }]
[{assign var="blShowMore" value=false }]
[{assign var="iCatCnt" value=0}]
<ul id="b24tree" class="sf-menu[{if $homeSelected == 'false'}] disable[{/if}]" role="menu">
<li class="categories"><a href="#">[{oxmultilang ident="CATEGORIES"}]</a>
<ul class="aim-menu">
[{foreach from=$oxcmp_categories item=ocat key=catkey name=root}]
[{if $ocat->getIsVisible() }]
[{assign var="iCatCnt" value=$iCatCnt+1 }]
<li data-submenu-id="submenu-[{$iCatCnt}]" [{if $homeSelected == 'false' && $ocat->expanded}]class="current"[{/if}]>
<a [{if $homeSelected == 'false' && $ocat->expanded}]class="current"[{/if}] href="[{$ocat->getLink()}]">
[{$ocat->oxcategories__oxtitle->value}]
[{if $oView->showCategoryArticlesCount() && ($ocat->getNrOfArticles() > 0) }]
([{$ocat->getNrOfArticles()}])
[{/if}]
</a>
[{if $ocat->getSubCats()}]
<div id="submenu-[{$iCatCnt}]" class="popover">
<h3 class="popover-title">[{$ocat->oxcategories__oxtitle->value}]</h3>
<div class="popover-content">
<ul class="linklist">
[{foreach from=$ocat->getSubCats() item=osubcat key=subcatkey name=SubCat }]
[{if $osubcat->getIsVisible() }]
<li [{if $homeSelected == 'false' && $osubcat->expanded}]class="current"[{/if}] >
<a [{if $homeSelected == 'false' && $osubcat->expanded}]class="current"[{/if}] href="[{$osubcat->getLink()}]">
[{$osubcat->oxcategories__oxtitle->value}]
[{if $oView->showCategoryArticlesCount() && ($osubcat->getNrOfArticles() > 0)}]
([{$osubcat->getNrOfArticles()}])
[{/if}]
</a>
[{if $osubcat->getSubCats()}]
<ul>
[{foreach from=$osubcat->getSubCats() item=osubsubcat key=subsubcatkey name=SubSubCat }]
[{if $osubsubcat->getIsVisible() }]
<li [{if $homeSelected == 'false' && $osubsubcat->expanded}]class="current"[{/if}] >
<a [{if $homeSelected == 'false' && $osubsubcat->expanded}]class="current"[{/if}] href="[{$osubsubcat->getLink()}]">
[{$osubsubcat->oxcategories__oxtitle->value}]
[{if $oView->showCategoryArticlesCount() && ($osubsubcat->getNrOfArticles() > 0)}]
([{$osubsubcat->getNrOfArticles()}])
[{/if}]
</a>
</li>
[{/if}]
[{/foreach}]
</ul>
[{/if}]
</li>
[{/if}]
[{/foreach}]
</ul>
<a href="#" class="featured">
<img src="/out/b24/img/example-chair-2.png">
</a>
</div>
</div>
[{/if}]
</li>
[{/if}]
[{/foreach}]
</ul>
</li>
</ul>
Hier geht es nicht weiter: [{if $osubcat->getSubCats()}]
Kann man anhand des Ausschnitts vielleicht irgendeinen Fehler erkennen?
Danke für Tipps