I am writing a template and if 2 fields, one of which is required the other is not. I would like to display the one thats not required if has been filled out by the user.
I have tried numerous things
{% if content.not_required %}
{{ content.not_required }}
{%else%}
{{ content.required }}
{% if content.not_required is null %}
{{ content.required }}
{%else%}
{{ content.required }}
{% if content.not_required == false %}
{{ content.required }}
{%else%}
{{ content.required }}
{% if content.not_required == null %}
{{ content.required }}
{%else%}
{{ content.required }}
{% if not content.not_required %}
{{ content.required }}
{%else%}
{{ content.required }}
all of these display all stories the same whether or not content.not_required was filled in.
Is there a way to do this in twig or do I need to set up some variable in a preprocess function?