Answers.Body: <p>That solution is viable. You can just test to see if the entry or the template matches your 404 template/entry. If you routed everything correctly to display a 404 in case of error, you should be fine.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-02T19:39:43.903Z
Answers.LastActivityDate: 2015-07-02T19:39:43.903Z
Answers.UserDisplayName: unsider
Body: <p>In my 404 template I am extending a layout template. Inside that layout template I want to hide a section use an <code>{% if craft.request... == 404 %}</code> test. Any ideas on how I can accomplish this?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-07-02T19:24:21.687Z
Comments.Text: I found a solution after I posted this... this seems to work but I am not sure if it is accurate.
  
  `{% if not entry %}`
Comments.UserDisplayName: Taylor
Tags: <404-page><404>
Title: How can I test if a request returns a 404?
ThreadText: # How can I test if a request returns a 404?
  
  (Asked by: username_0 on 2015-07-02)
  
  In my 404 template I am extending a layout template. Inside that layout template I want to hide a section use an `{% if craft.request... == 404 %}` test. Any ideas on how I can accomplish this?
  
  **Tags:** 404-page, 404
  
  > **Comments:**
  > **username_0**: I found a solution after I posted this... this seems to work but I am not sure if it is accurate.  `{% if not entry %}`  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-07-02. Score: 1 | Accepted answer
  
  That solution is viable. You can just test to see if the entry or the template matches your 404 template/entry. If you routed everything correctly to display a 404 in case of error, you should be fine.
  
  
  ---
  
  