<p>You've just got quotes wrapped around a simple string. Try something like this instead...</p>

<pre><code>{% if segment1 in ['one','two','three'] %}
</code></pre>

<p>That will check to see if your <code>segment1</code> value is in the array of possible matches.</p>

CC BY-SA 3.0
2014-10-08T09:40:03.430Z
Super thanks. I got caught out by the "in"!
Simon Clayson
CC BY-SA 3.0
2014-10-02T19:14:45.820Z
2014-10-02T19:14:45.820Z
Lindsey D
<p>Got myself into a seemingly simple dead-end block with twig syntax. I need to test against multiple items:</p>

<pre><code>{% set segment1 = craft.request.firstSegment %}
{% if segment1 == 'one OR two OR three' %}
DO SOMETHING
{% endif %}
</code></pre>

<p>What's going wrong with this bit 'one OR two OR three'? brackets?</p>

<templating>
Testing "if" against multiple segments
# Testing "if" against multiple segments

(Asked by: username_0 on 2014-10-02)

Got myself into a seemingly simple dead-end block with twig syntax. I need to test against multiple items:
{% set segment1 = craft.request.firstSegment %}
{% if segment1 == 'one OR two OR three' %}
DO SOMETHING
{% endif %}

What's going wrong with this bit 'one OR two OR three'? brackets?

**Tags:** templating

---

## 1 answers

### Answer by username_1 on 2014-10-02. Score: 9 | Accepted answer

You've just got quotes wrapped around a simple string. Try something like this instead...
{% if segment1 in ['one','two','three'] %}

That will check to see if your segment1 value is in the array of possible matches.

> **Comments:**
> **username_0**: Super thanks. I got caught out by the "in"!  

---

