[FMPP] How to use nested directives?
Brought to you by:
ddekany
|
From: Stefan U. <su...@su...> - 2012-05-22 15:04:28
|
Hi fmpplers,
I try to generate my menus dynamically and to activate the current menu item. So I use one directive
inside another but I do not know how to do it right. The following is taken from the example below:
<#if outFile?index_of(m.item.link) != -1> <!-- m.item.link is undefined -->
<#if outFile?index_of(${m.item.link}) != -1> <!-- syntax error -->
Complete example:
<#assign menus = [
{"item": {"name": "Motive", "link": "motive.html"}},
{"item": {"name": "Action", "link": "action.html"}},
]>
<#if currentLanguage == "es">
<#assign menus = [
{"item": {"name": "Motivos", "link": "es/motive.html"}},
{"item": {"name": "Acción", "link": "es/action.html"}},
]>
</#if>
<ul class="nav">
<#list menus as m>
<li <#if outFile?index_of(m.item.link) != -1>class="active"</#if>>
<a href="${m.item.link}">${m.item.name}</a>
</li>
</#list>
</ul>
How can I access the variable m.item.link in the #if?
Thanks,
Stefan
|