Linksseitige Navigation / Topnavigationspunkt ausblenden

Hi zusammen,

ja, dieses Thema wurde schon desöfteren hier besprochen, habe jetzt
mal in der category_tree.tpl alles soweit angepasst, dass nur noch die Unterkategorien ausgegeben werden. Nun kommt mir das Ganze etwas “unsauber” vor.

Kann vielleicht bitte mal jemand nen Blick riskieren und mir sagen, ob das so korrekt ist, müsste doch irgendwie einfacher gehen.

Hier also die category_tree.tpl:


[{if $tree || $oView->getContentCategory() }]
<strong class="h2">Kategorien</strong>
[{assign var="oContentCat" value=$oView->getContentCategory() }]
[{defun name="category_tree" tree=$tree act=$act class=$class testSubCat=''}]
[{strip}]
  <ul [{if $class}]class="[{$class}]"[{/if}]>   
    [{assign var="iCatCnt" value="1"}]
    [{foreach from=$tree item=ocat key=catkey name=$test_catName}]
        [{if ( !$ocat->isTopCategory() || !$oView->showTopCatNavigation() ) && $ocat->getContentCats() }]
            [{foreach from=$ocat->getContentCats() item=ocont key=contkey name=cont}]
            
                [{if $ocat->isTopCategory()}]
                    
                [{else}]
                    <li>
                    <a href="[{$ocont->getLink()}]">[{ $ocont->oxcontents__oxtitle->value }]</a>
                    </li>
                [{/if}]
            
            [{/foreach}]
        [{/if}]
        [{if $ocat->getIsVisible() }]
        
                [{if $ocat->isTopCategory()}]
                    
                [{else}]
                    
                    [{if $ocat->expanded}]
                    
                        <li>
                        <a 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}]" href="[{$ocat->getLink()}]">[{ $ocat->oxcategories__oxtitle->value }]</a>
                        [{if $ocat->getSubCats() && $ocat->expanded}]
                        [{fun name="category_tree" tree=$ocat->getSubCats() act=$act class="" testSubCat=$ocat->oxcategories__oxid->value }]
                        [{/if}]
                        </li>
                    
                    [{else}]
                                                                
                        <li>
                            <a href="[{$ocat->getLink()}]">[{ $ocat->oxcategories__oxtitle->value }]</a>
                        </li> 
                    
                    [{/if}]
                    
                [{/if}]
                
            [{if $ocat->getSubCats() && $ocat->expanded}]
                [{fun name="category_tree" tree=$ocat->getSubCats() act=$act class="" testSubCat=$ocat->oxcategories__oxid->value }]
            [{/if}]
        
        [{/if}]
        [{assign var="iCatCnt" value=$iCatCnt+1 }]
    [{foreachelse}]
        [{if $oContentCat }]            
            <li><a id="test_BoxLeft_Cms_0" class="root act" href="[{$oContentCat->getLink()}]">[{ $oContentCat->oxcontents__oxtitle->value }]</a></li>
        [{/if}]
    [{/foreach}]
   </ul>
[{/strip}]
[{/defun}]
[{/if}]

Dankeschön :slight_smile:

Allerbeste Grüße vom Chris