Tuesday 18 September 2007 5:57:44 am
Hello
In the code down i can't understand how it is possible variable $last=0 witch has a value 0 to become an array with value few rows down {set lastlevel=$last.level} . In {set lastlevel=$last.level} variable last is already array and has value. How it happens? Please help
$last=0 {*?template charset="utf-8"?*}
{def $depth=1 $last=0 $lastlevel=0 $x=1}
{def $mainMenu=treemenu( $module_result.path, $module_result.node_id,
, 0, 4)}
<ol> {foreach $mainMenu as $menu}
{set lastlevel=$last.level}
{if and($lastlevel|ne(0), $lastlevel|gt($menu.level))}
</ol>
</li>
{set lastlevel=$lastlevel|sub(1)}
{/if}
<li>
{if and($last | ne(0), $last.level|lt($menu.level))}
<ol>
<li{$menu.is_selected|choose('',' class="selected"')}>
{/if}
<a {$menu.is_selected|choose('','class="selected"')}
href={$menu.url_alias|ezurl}>{$menu.text|shorten(25)}</a>
</li>
{set last=$menu}
{/foreach}
{while $depth |gt(1)}
</li>
</ol>
{set depth=$depth|sub(1)}
{/while} </ol>
|