Conditional keyword for GET variables


#1

**Matrix Version:5.3.4.0

I passed GET variable from a paint layout contain container to an asset listing. I have been able to get the value, eg. the name of the variable is size using %nested_get_size%

My question is: can we use the begin/else/end condition for this?

It doesn’t seem the following evaluates correctly:

%begin_nested_get_size^eq:3%


#2

Has anyone done this before? Would like to know their experience with this …

Actually I just need to know if the syntax is valid at all … ie if the nested_ keyword can be used with condition.


(Bart Banda) #3

As long as you have the %end_nested% syntax as well it should work.
I just tested this in the latest 5.4 and it worked:

%begin_nested_get_size^eq:3%TRUE%end_nested%

Seeing as you are on 5.3.4.0 though, there might have been a bug that was fixed with that a while ago?

You could also try and use %nested_get_size^eq:3:THREE:NOT_THREE% to see if that works?


#4

Hi @Bart It might be a bug in 5.3.4 I can’t get it to work.

I have the following:

<p>Size: %nested_get_size%</p>
<p>%nested_get_size^eq:3:THREE:NOT_THREE%</p>

And I got the following output:

<p>Size: 3</p>
<p>NOT_THREE</p>

(Bart Banda) #5

Hmm, yea must be then. What’s the full requirement of what you are trying to do? Might be other ways it can be achieved?


#6

Hi @Bart, I got around it using Javascript to adjust the layout based on some condition that initially I would like to achieve using conditional keyword. At the moment that will do. I will revisit my implementation once we have been upgraded.