hallo,
ik wil graag een menu weergeven dat alleen pagina's laat zien op niveau 2. Dus bv alleen pagina's met id-nrs 3.1, 3.2, 3.3 etc. De onderliggende pagina's (3.1.1, 3.1.2 etc) en de 'root' (3.0) wil ik niet laten zien.
Ik heb nu deze code in het sjabloon staan: {menu template='gg_menu' collapse='1' start_element='3' excludeprefix='pagina-alias van de root'}. De excludeprefix heeft echter geen effect op de root.
pagina's op niveau 3 (dus 3.1, 3.2 etc.) worden niet getoond (dat werkt dus zoals ik wil) maar wel de root (3.0). Die wil ik dus ook nog laten 'verdwijnen'. Weet iemand van jullie hoe ik het gewenste effect kan bereiken?
Alvast bedankt,
RJ
[opgelost] menu-vraagje
Moderator: velden
[opgelost] menu-vraagje
Last edited by rj on Sat Sep 25, 2010 6:38 pm, edited 1 time in total.
Re: menu-vraagje
----------
Last edited by deactivated010521 on Tue Mar 12, 2013 4:25 pm, edited 2 times in total.
Re: menu-vraagje
Arnoud, bedankt voor je reactie. Ik ben echter niet zo'n php-held. Vraag of je me kunt aangeven waar ik de code precies in de menu-code moet plakken.
dit is mijn huidige menu-code:
Alweer bedankt!
dit is mijn huidige menu-code:
Code: Select all
{* 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}
Re: menu-vraagje
Werkt het niet als je menu met de childrenof-parameter oproept?
Ronny
Ronny
Re: menu-vraagje
----------
Last edited by deactivated010521 on Tue Mar 12, 2013 4:25 pm, edited 2 times in total.
Re: menu-vraagje
@arnoud,
Dit is opgelost 
Ronny
Niet in 1.9@ronny childeren of laat ook 'een-sub-sub' zien Angry


Ronny
Re: menu-vraagje
@arnoud: het lukt helaas niet.
Probleem is dat ik niet precies weet waar ik jouw extra stukje code in mijn huidige menu-template moet plaatsen. Ik heb al vanalles geprobeerd maar helaas zonder succes. Steeds foutmeldingen op de plaats waar het menu in de pagina moet worden getoond 


Re: menu-vraagje
{* 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}
{foreach from=$nodelist item=node name=loop}
{if $smarty.foreach.loop.index != '0'}
{if $node->depth > $node->prevdepth}
{repeat string="" times=$node->depth-$node->prevdepth}
{elseif $node->depth prevdepth}
{repeat string="" times=$node->prevdepth-$node->depth}
{elseif $node->index > 0}
{/if}
{if $node->current == true}
Current page is {$node->hierarchy}: {$node->menutext}
{elseif $node->parent == true}
url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}>{$node->hierarchy}: {$node->menutext}
{elseif $node->type == 'sectionheader'}
{$node->menutext}
{elseif $node->type == 'separator'}
{else}
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}>{$node->hierarchy}: {$node->menutext}
{/if}
{/if}
{/foreach}
{repeat string="" times=$node->depth-1}
{/if}
Re: menu-vraagje
Ah...het werkt!
Thnx
Ik plakte ook onderstaand stukje code mee....
- skip me
{else}
{$node|@print_r}
Hoefde dus blijkbaar niet...

Ik plakte ook onderstaand stukje code mee....
- skip me
{else}
{$node|@print_r}
Hoefde dus blijkbaar niet...