Template with more states

Hello there,

I have a variable in a script, the states are several options:

Geen
Plastic
Papier
Gft

Now I want to use that variable in a condition, I got it working when I use one state like {{ morgen == ‘paper’ }}

When I try to get more states in that line it won’t work!

I tried:
{{ morgen == ‘papier’,’gft’ }}
{{ morgen == (‘papier’,gft’) }}
{{ morgen == [‘papier’,’gft’] }}

Etc etc.
How can I get it passed on more states?

  • sorry I know some ‘ are not correct in this post, for some reason my phone does that.
{{ morgen in ('papier', 'gft') }}

It’s case-sensitive, so check what the states actually are, as your post contains both “Papier” and “papier”.

My example above uses a tuple, which is a list that cannot be altered once created. In Python, at least, it’s allegedly faster. You could also use a normal list:

{{ morgen in ['papier', 'gft'] }}

Thank you, that worked! :ok_hand: