I am using a conditional to format a cell in a table by adding a class based upon this:
<td class ="game-spread[wpv-conditional if="( $(wpcf-spread) gte '6' )"] yellow[/wpv-conditional] cell-[types field="game-number"][/types]">[types field="spread"][/types]</td>
This works fine, I also need to add a conditional for a negative number like this:
<td class ="game-spread[wpv-conditional if="( $(wpcf-spread) lte '-6' )"] yellow[/wpv-conditional] cell-[types field="game-number"][/types]">[types field="spread"][/types]</td>
This does not work, any idea why?
Hello,
Could you please try to swap $(wpcf-spread) and '-6'? make sure that you have the right comparison operator after this change.
Please try this:
<td class ="game-spread[wpv-conditional if="( '-6' gte $(wpcf-spread) )"] yellow[/wpv-conditional] cell-[types field="game-number"][/types]">[types field="spread"][/types]</td>
Let me know if that worked.
That almost worked, I had to add an if statement in order to only apply it to cells that had content.
[wpv-conditional if="( NOT(empty($(wpcf-spread)))) AND ( '-6' gte $(wpcf-spread) )"] yellow[/wpv-conditional]