// plain
XOR (Exclusive OR) is a logical operator in Twig that can be used to compare two values and return a boolean result. It is similar to the OR operator, but it only returns true if one of the values is true and the other is false.
{% if (value1 XOR value2) %}
<p>One of the values is true and the other is false.</p>
{% endif %}
One of the values is true and the other is false.
value1
andvalue2
: two values to be comparedXOR
: the XOR operatorif
: the Twig conditional statement
onelinerhub: How to use XOR in Twig with PHP?