# Is there a ternary operator in Tera?

**URL:** <https://zola.discourse.group/t/is-there-a-ternary-operator-in-tera/1480>\
**Category:** Support\
**Created:** [September 20, 2022, 6:27pm UTC](https://zola.discourse.group/t/is-there-a-ternary-operator-in-tera/1480 "2022-09-20T18:27:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DrGo](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/drgo/32/828_2.png) [@DrGo](https://zola.discourse.group/u/DrGo)\
**Post date:** [September 20, 2022, 6:27pm UTC](https://zola.discourse.group/t/is-there-a-ternary-operator-in-tera/1480/1 "2022-09-20T18:27:35Z")

</div>

something like in Jinja

```auto
{{ "Update" if changed else "Continue" }}

```

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [September 20, 2022, 7:05pm UTC](https://zola.discourse.group/t/is-there-a-ternary-operator-in-tera/1480/2 "2022-09-20T19:05:39Z")

</div>

No. I’m debating whether to add it for Tera 2 but tbh I find `{% if changed %}Update{% else %}Continue{% endif %}` much clearer, although it cannot be used in some cases.

---

<div class="post-metadata">

**Author:** ![DrGo](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/drgo/32/828_2.png) [@DrGo](https://zola.discourse.group/u/DrGo)\
**Post date:** [September 20, 2022, 9:27pm UTC](https://zola.discourse.group/t/is-there-a-ternary-operator-in-tera/1480/3 "2022-09-20T21:27:06Z")

</div>

Agree it has the potential to obscure logic branching but in a templating language it might actually improve clarity by reducing the already abundant clutter.
