<p>Why don't you just grab <a href="https://docs.craftcms.com/v3/dev/element-queries/entry-queries.html#status" rel="nofollow noreferrer">disabled</a> entries from the <a href="https://docs.craftcms.com/v3/dev/element-queries/entry-queries.html#authorid" rel="nofollow noreferrer">author</a>?</p>

<pre class="lang-TWIG prettyprint-override"><code>{% set entries = craft.entries
    .section('profileEntry')
    .status('disabled')
    .authorId(currentUser.id)
    .all() %} 
</code></pre>

<p>Then you can <a href="https://twig.symfony.com/doc/2.x/tags/for.html#the-else-clause" rel="nofollow noreferrer">loop</a> those</p>

<pre class="lang-twig prettyprint-override"><code>{% for entry in entries %}
    {{ entry.title }}
{% else %}
    no entries found
{% endfor %}
</code></pre>

CC BY-SA 4.0
2019-02-18T12:36:44.870Z
2019-02-18T12:36:44.870Z
Robin Schambach
<p>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.</p>

<p><strong>Version 1</strong> 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).</p>

<pre><code>{% 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 %}
</code></pre>

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

<pre><code>{% 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 %}
</code></pre>

<entries><status>
Display notification if no entries exist for status criteria and logged in user
# Display notification if no entries exist for status criteria and logged in user

(Asked by: username_0 on 2019-02-18)

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') %}

                {{ entry.title }}

                {% else %}

                No entries exist

            {% 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 %}

        {{ entry.title }}

        {% else %}

        No entries exist

        {% endif %}


{% endfor %}

**Tags:** entries, status

---

## 1 answers

### Answer by username_1 on 2019-02-18. Score: 2 | Accepted answer

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 %}


---

