Answers.Body: <p>Sorry... while searching for an answer to something else I discovered the solution to this :/</p>
  
  <pre><code>{% if craft.request.getSegment(1) != index.uri %}
  
      .... leave this chunk of code out
  
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-16T10:31:55.703Z
Answers.LastActivityDate: 2015-10-16T15:39:58.310Z
Answers.LastEditDate: 2015-10-16T15:39:58.310Z
Answers.UserDisplayName: Martin
Body: <p>I have a site consisting of 15 templates, all of which extend <code>_layout.html</code>.  There is just one page (homepage) which needs to omit a chunk of the <code>_layout.html</code>.  Is there something I can add to <code>_layout</code> which says "if I'm on the homepage leave this chunk of code out"?</p>
  
  <p>Many thanks</p>
  
  <p>Martin</p>
  
Tags: <templating><segments>
Title: Filter out part of _layout on a specific template
ThreadText: # Filter out part of _layout on a specific template
  
  (Asked by: username_0 on 2015-10-16)
  
  I have a site consisting of 15 templates, all of which extend `_layout.html`. There is just one page (homepage) which needs to omit a chunk of the `_layout.html`. Is there something I can add to `_layout` which says "if I'm on the homepage leave this chunk of code out"?
  
  Many thanks
  
  username_0
  
  **Tags:** templating, segments
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2015-10-16. Score: 1
  
  Sorry... while searching for an answer to something else I discovered the solution to this :/
  
  ```
  {% if craft.request.getSegment(1) != index.uri %}
  
      .... leave this chunk of code out
  
  {% endif %}
  
  ```
  
  
  ---
  
  