Display notification if no entries exist for status criteria and logged in user I'm aiming to display disabled entries for a logged in user and a message if no entries with this criteria exist. I've tried two different ways without success.

Version 1 gets all entries - live and disabled, gets those by the logged in user, and then tests for the entry status of disabled (which doesn't work).

{% set entries = craft.entries
    .section('profileEntry')
    .status(null)
    .all() %}

     {% for entry in entries %}

        {% if currentUser.id == entry.author.id %}

            {% if entry.status == entry.status('disabled') %}

                &lt;p&gt;{{ entry.title }}&lt;/p&gt;

                {% else %}

                &lt;p&gt;No entries exist&lt;/p&gt;

            {% endif %} 

        {% endif %}     


    {% endfor %}


Version 2 only gets the disabled status entries, then the entries by the logged in user. Which doesn't work either.

{% set entries = craft.entries
    .section('profileEntry')
    .status('disabled')
    .all() %}    

{% for entry in entries %}

        {% if currentUser.id == entry.author.id %}

        &lt;p&gt;{{ entry.title }}&lt;/p&gt;

        {% else %}

        &lt;p&gt;No entries exist&lt;/p&gt;

        {% endif %}


{% endfor %}
Why don't you just grab disabled entries from the author?

{% set entries = craft.entries
    .section('profileEntry')
    .status('disabled')
    .authorId(currentUser.id)
    .all() %} 


Then you can loop those

{% for entry in entries %}
    {{ entry.title }}
{% else %}
    no entries found
{% endfor %}