I want to do something IF flag isn't set to HOT or SALE. I also thought having it case insensitive would be nice.
but i'm having a brain fat on using NOT and IN within an if statement.
Let's say g.thisprod:flag is either empty or contains NEW
I want to test for HOT or SALE, if those values are in the flag.. then I do not want to do anything.
But if flag is empty or contains any other value, then I do want to do some stuff.
this code doesn't work but I Think it should:
this does work. but it's awkward to maintain as I add possible values to flag and it isn't case insensitive, so I don't want to use this.
my understanding is that using the IN is much faster than an x or y .
Also I want it to be really easy to add things into that list.. so I want to use the listing of values in the conditional.
Can someone straighten me out on the syntax?
but i'm having a brain fat on using NOT and IN within an if statement.
Let's say g.thisprod:flag is either empty or contains NEW
I want to test for HOT or SALE, if those values are in the flag.. then I do not want to do anything.
But if flag is empty or contains any other value, then I do want to do some stuff.
this code doesn't work but I Think it should:
Code:
<mvt:if expr="NOT(g.thisprod:flag IN '|HOT|SALE|')"> do something </mvt:if>
this does work. but it's awkward to maintain as I add possible values to flag and it isn't case insensitive, so I don't want to use this.
Code:
<mvt:if expr="(g.thisprod:flag NE 'HOT') OR (g.thisprod:flag NE 'SALE')"> do something </mvt:if>
Also I want it to be really easy to add things into that list.. so I want to use the listing of values in the conditional.
Can someone straighten me out on the syntax?
Comment