Is it possible to apply a condition to a w:for_each loop?

I have two CIT's:  Awards and Entries.  I've set the Entries up as a related item in the Award CIT.   I only want to show entries with status value == 'finalist' and award year == '2013'.  Here's an example:

<w:name />
  <w:for_each in="entries" condition="in.status=='finalist' && in.year == '2013''">
    <w:get name='in.name' /><w:get name='in.status' />
  </w:for_each>
</w:kb:item:each>

Have more questions? Submit a request

1 Comments

  • 0
    Avatar
    Andrew DesChenes

     

    Cindy,

    The for_each tag does not support conditions.  You will have to use a condition INSIDE the for_each loop  to filter your results.

    w:for_each

           w:if condition="in.status=='finalist'&&in.year=='2013"

                do something

          /w:if

    /w:for_each

     

     

     

     

     

     

     

     

     

     

     

Please sign in to leave a comment.
Powered by Zendesk