How to use nested directives?
Stefan Undorf <[email protected]> Tue, 22 May 2012 10:50:17 -0400
| Newsgroups | gmane.comp.text.fmpp |
|---|---|
| Message-ID | <[email protected]> |
Hi fmpplers,
I try to generate my menus dynamically and to activate the current menu ite=
m. 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) !=3D -1> <!-- m.item.link is undefi=
ned -->
<#if outFile?index_of(${m.item.link}) !=3D -1> <!-- syntax error -->
Complete example:
<#assign menus =3D [
{"item": {"name": "Motive", "link": "motive.html"}},
{"item": {"name": "Action", "link": "action.html"}},
]>
<#if currentLanguage =3D=3D "es">
<#assign menus =3D [
{"item": {"name": "Motivos", "link": "es/motive.html"}},
{"item": {"name": "Acci=F3n", "link": "es/action.html"}},
]>
</#if>
<ul class=3D"nav">
<#list menus as m>
<li <#if outFile?index_of(m.item.link) !=3D -1>class=3D"active"=
</#if>>
<a href=3D"${m.item.link}">${m.item.name}</a>
</li>
</#list> =
</ul>
How can I access the variable m.item.link in the #if?
Thanks,
Stefan
---------------------------------------------------------------------------=
---
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and =
threat landscape has changed and how IT managers can respond. Discussions =
will include endpoint security, mobile security and the latest in malware =
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/