I use the pageProperty function to manage some of my menus that are in my layout. I need to apply certain classes to the links, depending on what metadata the Property page returns. Right now, it looks like this ...
<g:if test="${pageProperty(name:'meta.nav') == 'support'}"> <g:link class="selected" ...>support</g:link> </g:if> <g:else> <g:link ...>support</g:link> </g:else>
I would like to clear this, however this does not work.
<g:link class="${pageProperty(name:'meta.nav') == 'support' ? selected : null}" ...>support</g:if>
I tried several different options for paranthesis and no one seems to get what I need. For instance:
${(pageProperty(name:'meta.nav') == 'support') ? selected : null} ${(pageProperty(name:'meta.nav') == 'support' ? selected : null)}
It just doesn't seem to be acting correctly. Any help is appreciated.
Gregg source share