<p>You want:</p>

<pre><code>{% if craft.request.firstSegment == 'This' or craft.request.firstSegment == 'That' %}
</code></pre>

<p>or this would work:</p>

<pre><code>{% if craft.request.firstSegment in ['This', 'That'] %}
</code></pre>

CC BY-SA 3.0
2015-06-17T02:38:56.177Z
2015-06-17T02:38:56.177Z
Marion Newlevant
<p>I'm trying to use a conditional to do something if the first segment matches This <em>or</em> That. But I'm unable to come up with the right operator for the "or"</p>

<pre><code>{% elseif craft.request.firstSegment == 'This' || 'That' %}
</code></pre>

<p>What's the proper operator here? Thanks!</p>

<templating><conditional>
Comparison "or" conditional
# Comparison "or" conditional

(Asked by: username_0 on 2015-06-17)

I'm trying to use a conditional to do something if the first segment matches This or That. But I'm unable to come up with the right operator for the "or"
{% elseif craft.request.firstSegment == 'This' || 'That' %}

What's the proper operator here? Thanks!

**Tags:** templating, conditional


---

## 1 answers

### Answer by username_1 on 2015-06-17. Score: 12 | Accepted answer

You want:
{% if craft.request.firstSegment == 'This' or craft.request.firstSegment == 'That' %}

or this would work:
{% if craft.request.firstSegment in ['This', 'That'] %}


---

