Multi-lingual Navigation

Description

Here is an example of how to do multi-lingual navigation using the navtool. You need to have your language keys set up and then make each page title a language key and then the following should work.

Code

${esc.h}set(${esc.d}list = ${esc.d}navtool.getNav("/"))
${esc.h}foreach(${esc.d}n in ${esc.d}list)
	<li class="divider"></li>
	${esc.h}set(${esc.d}children = ${esc.d}n.children)
	${esc.h}if(${esc.d}children && ${esc.d}children.size() > 0)
		<li class="has-dropdown ${esc.h}if(${esc.d}n.active) active ${esc.h}end">
			<a href="${esc.d}{n.href}">${esc.d}text.get( ${esc.d}{n.title} )</a>
			<ul class="dropdown">
				${esc.h}foreach(${esc.d}ch in ${esc.d}children)
					<li ${esc.h}if(${esc.d}ch.active) class="active" ${esc.h}end><a href='${esc.d}{ch.href}'>${esc.d}text.get( ${esc.d}{ch.title} )</a></li>
				${esc.h}end
			</ul>
		</li>
	${esc.h}else
		<li class="${esc.h}if(${esc.d}n.active) active ${esc.h}end"><a href='${esc.d}{n.href}'>${esc.d}text.get( ${esc.d}{n.title} )</a></li>
	${esc.h}end
${esc.h}end