我尝试用 Velocity 制作新的 Liferay 主题。我想制作多级菜单。我可以像这样用手制作关卡:
<ul class="obsm">
#foreach ($nav_item in $nav_items)
#if ($nav_item.isSelected())
<li class="active">
#else
<li>
#end
<a href="$nav_item.getURL()" $nav_item.getTarget()><span>$nav_item.icon() $nav_item.getName()</span></a>
#if ($nav_item.hasChildren())
<ul>
#foreach ($nav_child in $nav_item.getChildren())
#if ($nav_child.isSelected())
<li class="active">
#else
<li>
#end
<a href="$nav_child.getURL()" $nav_child.getTarget()>$nav_child.getName()</a>
#if ($nav_child.hasChildren())
<ul>
#foreach ($nav_child in $nav_child.getChildren())
#if ($nav_child.isSelected())
<li class="active">
#else
<li>
#end
<a href="$nav_child.getURL()" $nav_child.getTarget()>$nav_child.getName()</a>
</li>
#end
</ul>
#end
</li>
#end
</ul>
#end
</li><br>
#end
</ul>
有 3 级菜单。但它并不好。我想做无限关卡菜单。这是可能的?