Forums/How Do I ... ?

Set a variable, then pass to a tag name inside a <w:for_each in loop... is this possible...

Luke
posted this on February 11, 2012, 17:42

OK somewhere near the top of my page i'm setting a variable as follows

<w:var name="tag-name"><w:tags/></w:var>

later on my page in side a for_each loop i'm referencing this variable as follows

<w:if condition="in.titleposition == 1">
                       <ul class="docs">
                         <w:assets:each limit='3' tag='{{tag-name}}'>
                         <li>
                           <href="<w:path rendition='pop'/>" class="fancybox" title="<w:caption/> <w:var name='tag-name' />">
                           <span class="icon"><img src="<w:path rendition='icon'/>"></span>
                           <span class="name"><w:caption truncate="10 words"/></span>
                         </a>
                         </li>
                       </w:assets:each>
                     </ul>
                     </w:if>

It appears that the variable isn't available to my tag name in this situation, but it is available to the my title. I'm confused, shouldn't tags support nested variables?currently doesn't seem to work in the example...

 

Cheers

Luke

 

Comments

User photo
Christopher Haupt
Webvanta

Luke, I believe this was answered in a side channel, but for the forums benefit:

The w:assets tags currently have less support for the variable substitution mechanism. One trick that will work specifically for what you want to do is listed in the cheat sheet is to use tag="var[kb:item:tag]" on your assets:each iterator.

We'll include the variable syntax in an upcoming deployment.

February 13, 2012, 16:03