# ifnotequal

Source: https://zotonic.com/docs/1367/ifnotequal

URI: https://zotonic.com/id/1367

Language: en



::: {.aside}
See also

<a href="/id/doc_template_tag_tag_if" class="doc-reference doc-reference-tag"><code>tag#if</code></a> and <a href="/id/doc_template_tag_tag_ifequal" class="doc-reference doc-reference-tag"><code>tag#ifequal</code></a>.
:::

Show something if two values are not equal.

The `{% ifnotequal %}` tag tests if its two arguments are unequal. If so then the contents of the `{% ifnotequal %}` tag are output, otherwise the contents of the optional `{% else %}` tag are output.

For example:

```erlang
{% ifnotequal value 5 %}
  Value is {{ value }} which is not 5.
{% else %}
  Value is 5.
{% endifnotequal %}
```

It is only possible to compare arguments that are variables (with optional filters) or constants. Examples of constants are numbers, strings or lists.

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1367?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1367?language=en>)
