{function name=menu level=0}
	<ul class="level{$level}">
		{foreach $data as $item}
			<li{if $item.active} class="active"{/if} id="treeMenu{$item.tree_id}">
				{if $item.path}<a {if $item.current}class="current"{/if} href='{url href=$item.path}' >{$item.name|escape}</a>{else}{$item.name|escape}{/if}
			{if $item.subtree}
				{call name=menu data=$item.subtree level=$level+1}
			{/if}
			</li>
		{/foreach}
	</ul>
{/function}

<div id="treeMenu">
	{menu data=$tree}
</div>