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') %}
<p>{{ entry.title }}</p>
{% else %}
<p>No entries exist</p>
{% 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 %}
<p>{{ entry.title }}</p>
{% else %}
<p>No entries exist</p>
{% endif %}
{% endfor %}