in order for my client to have the choice of selecting options or not, I entered an empty (blank) option in a dropdown field.

In the frontend, I use this code:

{% if entry.dropdownFieldHandle|length %}
<dd>{{ entry.dropdownFieldHandle }}</dd>
{% endif %}

The problem is even if the client chooses the blank option, it still makes the code appear.

Where am I wrong?

1 Answer 1


If the client selects an empty value you probably will get an empty value back.

Try this:

{# Make sure we have a value #}
{% if entry.dropdownFieldHandle != "" %}
    <dd>{{ entry.dropdownFieldHandle }}</dd>
{% endif %}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.