# Conditional contact fields in the template

**URL:** <https://forum.mautic.org/t/conditional-contact-fields-in-the-template/20762>\
**Category:** Mautic 4 Install/Upgrade Support\
**Created:** [September 6, 2021, 7:11pm UTC](https://forum.mautic.org/t/conditional-contact-fields-in-the-template/20762 "2021-09-06T19:11:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexanderloewe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alexanderloewe/32/637_2.png) [@alexanderloewe](https://forum.mautic.org/u/alexanderloewe)\
**Post date:** [September 6, 2021, 7:11pm UTC](https://forum.mautic.org/t/conditional-contact-fields-in-the-template/20762/1 "2021-09-06T19:11:50Z")

</div>

How can I set conditional contact fields in the template?

Something like:

{if contactfield=title == Frau}‍  
Liebe {contactfield=firstname}‍  
{elseif contactfield=title == Herr}‍  
Lieber {contactfield=firstname}‍  
{endif}

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [September 7, 2021, 4:47am UTC](https://forum.mautic.org/t/conditional-contact-fields-in-the-template/20762/2 "2021-09-07T04:47:42Z")

</div>

Here you go, step by step:

> **[Mautic and the Beauty of the Deutsche Sprache – Joey Keller](https://joeykeller.com/mautic-and-the-beauty-of-the-deutsche-sprache/)**

---

<div class="post-metadata">

**Author:** ![alexanderloewe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alexanderloewe/32/637_2.png) [@alexanderloewe](https://forum.mautic.org/u/alexanderloewe)\
**Post date:** [September 7, 2021, 9:07am UTC](https://forum.mautic.org/t/conditional-contact-fields-in-the-template/20762/3 "2021-09-07T09:07:32Z")

</div>

Thanks. Wow and it’s Twig. Very simple!
