<p>If you're specifically checking for the admin, then it's more like:</p>

<pre><code>{% if currentUser.admin %}
    {% set slug = craft.request.lastSegment %}
    {% set entry = craft.entries.slug(slug).status(null).first %}

    {{ entry.title }}
{% endif %}
</code></pre>

<p>If you're getting a 404, then it's some other routing issues that is occurring.</p>

CC BY-SA 3.0
2015-01-08T10:10:51.937Z
Looked at apply this to "any" user - {% if user %} but if the entry is disabled then I can't see anything at all.

Tried also 
{% if entry.status == "['disabled', 'live']" %}
STUFF
{% endif %}

but can't get that far.
Simon Clayson
CC BY-SA 3.0
2014-12-03T01:25:58.893Z
2014-12-03T01:25:58.893Z
Brad Bell
<p>Something like this?</p>

<pre><code>{% if craft.session.isLoggedIn %}
    {% set slug = craft.request.lastSegment %}
    {% set entry = craft.entries.slug(slug).status(null).first %}
{% endif %}

{{ entry.title }}
</code></pre>

<p>But I get error page not found. </p>

CC BY-SA 3.0
2014-12-03T08:04:38.920Z
Non of this Twig code can cause a 404 page not found error, so you should rather check your [routing](http://buildwithcraft.com/docs/routing), Johannes.
carlcs
<entry><admin><status>
How to display an entry on frontend with status disabled if admin is logged in?
# How to display an entry on frontend with status disabled if admin is logged in?

(Asked by: username_0 on 2014-12-02)

Something like this?
{% if craft.session.isLoggedIn %}
    {% set slug = craft.request.lastSegment %}
    {% set entry = craft.entries.slug(slug).status(null).first %}
{% endif %}

{{ entry.title }}

But I get error page not found.

**Tags:** entry, admin, status
> **Comments:**
> **username_1**: Non of this Twig code can cause a 404 page not found error, so you should rather check your [routing](http://buildwithcraft.com/docs/routing), Johannes.  

---

## 1 answers

### Answer by username_2 on 2014-12-03. Score: 3

If you're specifically checking for the admin, then it's more like:
{% if currentUser.admin %}
    {% set slug = craft.request.lastSegment %}
    {% set entry = craft.entries.slug(slug).status(null).first %}

    {{ entry.title }}
{% endif %}

If you're getting a 404, then it's some other routing issues that is occurring.

> **Comments:**
> **username_3**: Looked at apply this to "any" user - {% if user %} but if the entry is disabled then I can't see anything at all.  Tried also  {% if entry.status == "['disabled', 'live']" %} STUFF {% endif %}  but can't get that far.  

---

