Du bist nicht angemeldet. Der Zugriff auf einige Boards wurde daher deaktiviert.
- Links zu: Aktiven | Unbeantworteten
- Übersicht
- »
- »
1
#1 10. Februar 2014 11:21
- marc164
- probiert CMSMS aus
- Ort: Alt Gaarz
- Registriert: 15. Dezember 2011
- Beiträge: 93
- Webseite
Re:
Guten Tag,
auf einer existierenden Seite möchte ich ein neues Template verwenden, aber das unterstützt nur 3 level submenus und ich habe schon 4. Die Seitenstruktur würde ich ungern ändern, wegen 404. Da es nur ein paar Seiten betrifft hatte ich angedacht, ein Menü einfach per Backend in die Sidebar zu setzen, hier als {menu template="menulevel3"}. Die Beschränkung auf die letzten 2 level funktioniert, aber das Menü wird doppelt ausgegeben. Ich habe jetzt schon eine ganze Weile rumprobiert und auch hier im Forum leider nix passendes finden können. Der code sieht folgendermaßen aus:
{menu start_level="3"}
{* CSS classes used in this template: .activeparent - The top level parent when a child is the active/current page li.active0n h3 - n is the depth/level of the node. To style the active page for each level separately. The active page is not clickable. .clearfix - Used for the unclickable h3 to use the entire width of the li, just like the anchors. See the Tools stylesheet in the default CMSMS installation. li.sectionheader h3 - To style section header li.separator - To style the ruler for the separator *}
{if $count > 0}
<ul> {foreach from=$nodelist item=node} {if $node->depth > $node->prevdepth} {repeat string="
<ul>" times=$node->depth-$node->prevdepth} {elseif $node->depth
< $node->prevdepth} {repeat string="
</li>
</ul>" times=$node->prevdepth-$node->depth}
</li> {elseif $node->index > 0}
</li> {/if} {if $node->current == true}
<li class="currentpage"><h3>
<dfn>Current page is {$node->hierarchy}:
</dfn>{$node->menutext}</h3> {elseif $node->parent == true}
<li class="activeparent">
<a class="activeparent" href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}>
<dfn>{$node->hierarchy}:
</dfn>{$node->menutext}</a> {elseif $node->type == 'sectionheader'}
<li class="sectionheader">{$node->menutext} {elseif $node->type == 'separator'}
<li class="separator" style="list-style-type: none;">
<hr /> {else}
<li>
<a href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}{if $node->target != ''} target="{$node->target}"{/if}>
<dfn>{$node->hierarchy}:
</dfn>{$node->menutext}</a> {/if} {/foreach} {repeat string="
</li>
</ul>" times=$node->depth-1}
</li>
</ul> {/if}Vielen Dank!
Markus
Offline
#2 16. Februar 2014 23:04
- cyberman
- Moderator

- Ort: Dohna / Sachsen
- Registriert: 13. September 2010
- Beiträge: 6.741
- Webseite
Re:
aber das Menü wird doppelt ausgegeben.
Logisch ... du rufst es ja auch zwei mal auf
{menu start_level="3"}
{* CSS classes used in this template: .activeparent - The top level parent when a child is the active/current page li.active0n h3 - n is the depth/level of the node. To style the active page for each level separately. The active page is not clickable. .clearfix - Used for the unclickable h3 to use the entire width of the li, just like the anchors. See the Tools stylesheet in the default CMSMS installation. li.sectionheader h3 - To style section header li.separator - To style the ruler for the separator *}{if $count > 0}
<ul> {foreach from=$nodelist item=node} {if $node->depth > $node->prevdepth} {repeat string="
<ul>" times=$node->depth-$node->prevdepth} {elseif $node->depth
< $node->prevdepth} {repeat string="
</li>
</ul>" times=$node->prevdepth-$node->depth}
</li> {elseif $node->index > 0}
</li> {/if} {if $node->current == true}
<li class="currentpage"><h3>
<dfn>Current page is {$node->hierarchy}:
</dfn>{$node->menutext}</h3> {elseif $node->parent == true}
<li class="activeparent">
<a class="activeparent" href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}>
<dfn>{$node->hierarchy}:
</dfn>{$node->menutext}</a> {elseif $node->type == 'sectionheader'}
<li class="sectionheader">{$node->menutext} {elseif $node->type == 'separator'}
<li class="separator" style="list-style-type: none;">
<hr /> {else}
<li>
<a href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}{if $node->target != ''} target="{$node->target}"{/if}>
<dfn>{$node->hierarchy}:
</dfn>{$node->menutext}</a> {/if} {/foreach} {repeat string="
</li>
</ul>" times=$node->depth-1}
</li>
</ul> {/if}
Der markierte Code darf nur 1x aufgerufen werden, in Normalfall im Haupt-Template - du hast ihn aber scheinbar noch mal im Menü-Template drin.
1. Wie bekomme ich hier schnelle Hilfe?
2. HowTo: Fehlersuche bei CMSMS
---
„First they ignore you, then they laugh at you, then they fight you, then you win.“ Mahatma Ghandi
Offline
#3 16. Februar 2014 20:05
- marc164
- probiert CMSMS aus
- Ort: Alt Gaarz
- Registriert: 15. Dezember 2011
- Beiträge: 93
- Webseite
Re:
Vielen Dank!
Offline
1
- Übersicht
- »
- »