[phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 1823: Undefined array key 2603
[phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 1833: Trying to access array offset on value of type null
[phpBB Debug] PHP Warning: in file [ROOT]/viewtopic.php on line 1833: Trying to access array offset on value of type null
CMS Made Simple Forums • [IŠSPRĘSTA] Meniu redagavimas
Page 1 of 1

[IŠSPRĘSTA] Meniu redagavimas

Posted: Sat Aug 09, 2008 7:24 pm
by Rkz
Noriu padaryti kad prie aktyvaus meniu būtų 0}
{foreach from=$nodelist item=node}
current == true} id="active" {/if} href="{$node->url}" {if $node->target ne ""} target="{$node->target}"{/if}
{if $node->current == true} id="active" {/if}>{$node->menutext}
{if $count > ($node->index+1)}
{/if}
{/foreach}
{/if}

Klaidų nemeta, bet ir id="active" nesuveikia :(
gal kas turite minčių ar esate darę kažką panašaus

Re: Meniu redagavimas

Posted: Sat Aug 09, 2008 7:51 pm
by Rkz
Ačiū už pagalbą, bet man nereikia taip sudėtingai,
nemanau kad čia kažin kas privelta, remiuosi šia info

http://wiki.cmsmadesimple.org/index.php ... nu_Manager

simple_menu
If | you | just | want | simple | menu

{if $count > 0}
{foreach from=$nodelist item=node}url}"
{if $node->target ne ""} target="{$node->target}"{/if}
>{$node->menutext}
{if $count > ($node->index+1)} |
{/if}
{/foreach}
{/if}
Author: Borislav Dopudja

Tiesiog norėjau papildyti current == true} būten ir identifikuoja aktyvų meniu, o man tik to ir tereikia, kad aktyviam meniu būtų pridedama id="active"

Re: Meniu redagavimas

Posted: Sun Aug 10, 2008 5:59 am
by Rkz
pas mane 1.4v, ar gali būti kad duotas kodas nesuveiktų, nes meniu atvaizduojamas .. bet be active

Re: Meniu redagavimas

Posted: Sun Aug 10, 2008 8:43 am
by Rkz
taip taip taip, viską taip ir padarau.
Viso turiu du templeitus, kitas rodo medį ir viskas yra gerai, jis padaro id="active".
Bet šis kažkodėl nepadaro, visa kita suveikia gerai be klaidų, gal tu ant savo cms kur gali pasibandyt savo kodą, kažkur ten gali būti spraga

Re: Meniu redagavimas

Posted: Sun Aug 10, 2008 9:13 am
by Rkz
čia turėtų veikti tik 1.1 1.2 1.3 1.4 1.5 meniu punktam

Re: Meniu redagavimas

Posted: Sun Aug 10, 2008 2:21 pm
by Rkz
na va pasidariau pagaliau kad veiktų, nežinau kodėl bet Karolio siūlytas variantas neveikė, šis veikia:

{if $count > 0}

{foreach from=$nodelist item=node}
{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->parent == true or ($node->current == true and $node->haschildren == true)}
current == true}
haschildren == true}
type == 'sectionheader'}
      {$node->menutext}
{elseif $node->type == 'separator'}
     
{else}
type != 'sectionheader' and $node->type != 'separator'}
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 ne ""} target="{$node->target}"{/if}>{$node->menutext}
{elseif $node->type == 'sectionheader'}
>{$node->menutext}
{/if}

{/foreach}

{repeat string="" times=$node->depth-1}


{/if}