Switch function of a matrix field
Hi
I'm trying to use a matrix field within low_variables. I have a problem with the switch function from matrix because it does not work in connection with low variables:
{exp:low_variables:pair var="insuranceclub:conditions_banker"}
<li class="{switch='even|odd'}">
{description}
</li>
{/exp:low_variables:pair}
I'm only getting "even". Do you know why it does not work?
Regards
Replies
Low 5 Feb 2014 11:21
I'm afraid this is more a Matrix issue than a LV issue, since LV just calls the Matrix functions, which returns the parsed content. Have you asked P&T about this?
Pibble 5 Feb 2014 11:25
Wow! First of all thanks for the very fast reply!
so the parsed content is
I tried it with another matrix field I have in a channel and there I get the suggested result:
Regards
Low 5 Feb 2014 11:29
I would definitely ask Pixel & Tonic about this, and point out this difference in parsing. Again, it's not something LV does itself, it calls Matrix, which takes care of the parsing.
As an alternative, you might be able to use the Modulus operator instead.
Pibble 5 Feb 2014 13:09
I'm getting an error using modulus operator:
Low 5 Feb 2014 13:10
What version of EE are you using?
Pibble 5 Feb 2014 13:13
EE 2.7.2
Low variables 2.4.0
Matrix 2.5.6
Pibble 5 Feb 2014 13:15
I think there is a problem with nesting the following code:
Pibble 5 Feb 2014 13:17
ok... Using the code with a prefix works for me:
Low 5 Feb 2014 13:18
Ah yes, nesting the tags will give you that behaviour. Glad you solved it now.