Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-01-08T10:10:51.937Z
Answers.Text: 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.
Answers.UserDisplayName: Simon Clayson
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-03T01:25:58.893Z
Answers.LastActivityDate: 2014-12-03T01:25:58.893Z
Answers.UserDisplayName: Brad Bell
Body: <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>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-12-03T08:04:38.920Z
Comments.Text: 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.
Comments.UserDisplayName: carlcs
Tags: <entry><admin><status>
Title: How to display an entry on frontend with status disabled if admin is logged in?
ThreadText: # 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), username_0.  
  
  ---
  
  ## 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.  
  
  ---
  
  