I have a custom field called orange_button set to display on pages. I created a View and tried to use a Twig if statement to only output some HTML if the field is not empty. Basically the field will contain a link to a page on the site which will display a button if the value is set or nothing if it is not.
This is my current if statement:
{% if '{{ post.orange_button }}' is empty %}
<span>No Value</span>
{% else %}
<a href="{{ post.orange_button.url }}">Book Your Free Consultation</a>
{% endif %}
But it just always shows the button regardless if the field is empty or not?
I'm totally new to =meta and twig so can anyone please point me in the right direction?