Hallo,
ich habe hier mal eine Lösung für die Anzeige der Kategorien/Unterkategorien, vielleicht kann ja jemand etwas damit anfangen.
Problemstellung: TopCat und SubCatsLevel2 (siehe Struktur) nicht anzeigen
Ausgangspunkt war folgende Struktur:
<TopCat1> //nicht anzeigen
----<SubCatLevel1> //anzeigen
--------<SubCatLevel2> //nicht anzeigen
----<SubCatLevel1> //anzeigen
--------<SubCatLevel2> //nicht anzeigen
Ich habe die Datei category_tree.tpl angepasst.
[B]alter Code: (ca. Zeile 12)[/B]
[{if $ocat->getIsVisible() }]
<li>
<a id=“test_BoxLeft_Cat_[{if $ocat->isTopCategory()}][{$ocat->oxcategories__oxid->value}]_[{$smarty.foreach.$test_catName.iteration}][{else}][{$testSubCat}]_sub[{$smarty.foreach.$test_catName.iteration}][{/if}]” href="[{$ocat->getLink()}]" class="[{if $ocat->isTopCategory()}]root [{/if}][{if $ocat->hasVisibleSubCats}][{if $ocat->expanded }]exp [{/if}]has [{else}]last [{/if}][{if isset($act) && $act->getId()==$ocat->getId() && !$oContentCat }]act [{/if}]">[{$ocat->oxcategories__oxtitle->value}] [{if $ocat->getNrOfArticles() > 0}] ([{$ocat->getNrOfArticles()}])[{/if}]</a>
[{if $ocat->getSubCats() && $ocat->expanded}]
[{fun name=“category_tree” tree=$ocat->getSubCats() act=$act class="" testSubCat=$ocat->oxcategories__oxid->value }]
[{/if}]
</li>
[{/if}]
[B]ersetzt durch: [/B]
[{if $ocat->getIsVisible() }]
<li>
[B][{if !$ocat->isTopCategory()}][/B] // [B]TopCat ausschliessen[/B]
<a id="test_BoxLeft_Cat_[{if $ocat->isTopCategory()}][{$ocat->oxcategories__oxid->value}]_[{$smarty.foreach.$test_catName.iteration}][{else}][{$testSubCat}]_sub[{$smarty.foreach.$test_catName.iteration}][{/if}]" href="[{$ocat->getLink()}]" class="[{if $ocat->isTopCategory()}]root [{/if}][{if $ocat->hasVisibleSubCats}][{if $ocat->expanded }]exp [{/if}]has [{else}]last [{/if}][{if isset($act) && $act->getId()==$ocat->getId() && !$oContentCat }]act [{/if}]">[{$ocat->oxcategories__oxtitle->value}] [{if $ocat->getNrOfArticles() > 0}] ([{$ocat->getNrOfArticles()}])[{/if}]</a>
[B] [{/if}][/B]
[{if $ocat->getSubCats() && $ocat->expanded}]
[B][{if $ocat->isTopCategory()}] [/B] //[B]SubCatLevel1 ist nun quasi TopCat, die SubCatsLevel2 werden somit ausgeschlossen[/B]
[{fun name="category_tree" tree=$ocat->getSubCats() act=$act class="" testSubCat=$ocat->oxcategories__oxid->value }]
[B][{/if}][/B]
[{/if}]
</li>
[{/if}]
Viele Grüße/Regards,
Tobias
www.boxyton.de