Back

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

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