As bandau pakeisti klases pavadinima (paryskinta raudonai), pvz. kai linkas neaktyvus rasytu "sub", kai aktyvus "sub-active".
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{if $node->depth == 2}
{else}
{repeat string='' times=$node->depth-$node->prevdepth}
{/if}
{elseif $node->depth prevdepth}
{repeat string="" times=$node->prevdepth-$node->depth}
{elseif $node->index > 0}
{/if}
The meniu html atrodytu taip:
Apie Mus
Apie Mus 1
Apie Mus 2
Apie Mus 3
Produktai
Produktai 1
Produktai 2
Produktai 3
Labai prasau jusu pagalbos! Dekoju...
Meniu/Navigacija klases pakeitimas kai aktyvus
Moderator: Augustas
Re: Meniu/Navigacija klases pakeitimas kai aktyvus
Labas, tavo pateiktas kodas arba nepilnas arba su gerokomis klaidomis. Kuriam meniu lygmeniui nori padaryti class = "sub" - tik antro lygio meniu?
vilkis
vilkis
Re: Meniu/Navigacija klases pakeitimas kai aktyvus
Sveikas, dekoju uz toki greita atsiliepima. Atsiprasau jog klaidinu ir neidedu pilno kodo. Taip, klase noriu pakeisti antrojo lygio sarasui (list).
{if $count > 0}
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{if $node->depth == 2}
{else}
{repeat string='' times=$node->depth-$node->prevdepth}
{/if}
{elseif $node->depth prevdepth}
{repeat string="" times=$node->prevdepth-$node->depth}
{elseif $node->index > 0}
{/if}
{if $node->depth == 2}
{if $node->parent == true or ($node->current == true && $node->haschildren == true && $node->depth == 3)}
{else}
{/if}
{/if}
depth == 3 && $node->current == true} class="current_sub"{/if}>url}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}
{/foreach}
{repeat string="" times=$node->depth-2}
{/if}
{if $count > 0}
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{if $node->depth == 2}
{else}
{repeat string='' times=$node->depth-$node->prevdepth}
{/if}
{elseif $node->depth prevdepth}
{repeat string="" times=$node->prevdepth-$node->depth}
{elseif $node->index > 0}
{/if}
{if $node->depth == 2}
{if $node->parent == true or ($node->current == true && $node->haschildren == true && $node->depth == 3)}
{else}
{/if}
{/if}
depth == 3 && $node->current == true} class="current_sub"{/if}>url}"{if $node->target ne ""} target="{$node->target}"{/if}>{$node->menutext}
{/foreach}
{repeat string="" times=$node->depth-2}
{/if}
Re: Meniu/Navigacija klases pakeitimas kai aktyvus
Žemiau pateiktas meniu šablonas tau turėtų tikti, tik pasikeisk klases:
vilkis
Code: Select all
{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><a href="{$node->url}" class="currentpage">{$node->menutext}</a></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}
vilkis