<p>You can check against the Entry Type as well. 
I would try to validate it with something like:</p>

<pre><code>{% set exclusions = ['home'] %}    
{% if entry.type not in exclusions %}
....
</code></pre>

CC BY-SA 3.0
2018-02-26T04:10:07.183Z
2018-02-26T04:19:11.693Z
2018-02-26T04:19:11.693Z
Jon Tastemel
<p>I'm currently trying to make my navigation be not included on my index page due to my loading a different style of page - but - include it on every other page. My current layout looks like so:</p>

<p><strong>_layout.html</strong></p>

<pre><code>{% set exclusions = ['index'] %}
{% if craft.request.firstSegment not in exclusions  %}
    {% include '_navigation' %}
{% endif %}
</code></pre>

<p>But this seems to not work on my <strong>"index.html"</strong> page. Do I need to set it a title? or set an exclusion name here?</p>

CC BY-SA 3.0
2018-02-25T16:51:28.320Z
Is the first segment blank by chance? If so you can check if it’s empty.
Shift2Design
CC BY-SA 3.0
2018-02-25T17:10:52.153Z
I'm not sure, I'm just trying to exclude this template when on the index page
JMKelley
CC BY-SA 3.0
2018-02-25T18:39:07.470Z
This will only work if your first url segment is 'index' so when your url is `www.example.com/index` it won't work for `www.example.com`. Do you have different templates for you first page and for the rest of them?
Robin Schambach
CC BY-SA 3.0
2018-02-25T20:36:50.993Z
@RobinSchambach I have a _layout.html include on the index page and within layout is navigation.html
JMKelley
CC BY-SA 3.0
2018-02-25T20:39:21.977Z
This doesn't answer my question. Do you use the template you use for your `index` page for any other page?
Robin Schambach
CC BY-SA 3.0
2018-02-25T20:40:02.853Z
@RobinSchambach Yes, It's my main _layout file, it's included on every page.
JMKelley
CC BY-SA 3.0
2018-02-25T20:43:09.550Z
I don't mean your layout file... When you set a bool variable to true in your index template and ask in your layout if the variable is defined and true. Would that work or do you use your index template for other entries too?
Robin Schambach
<blocks><layout>
Exclude a block from appearing on a specific page
# Exclude a block from appearing on a specific page

(Asked by: username_0 on 2018-02-25)

I'm currently trying to make my navigation be not included on my index page due to my loading a different style of page - but - include it on every other page. My current layout looks like so:
_layout.html
{% set exclusions = ['index'] %}
{% if craft.request.firstSegment not in exclusions  %}
    {% include '_navigation' %}
{% endif %}

But this seems to not work on my "index.html" page. Do I need to set it a title? or set an exclusion name here?

**Tags:** blocks, layout

> **Comments:**
> **username_1**: Is the first segment blank by chance? If so you can check if it’s empty.  
> **username_0**: I'm not sure, I'm just trying to exclude this template when on the index page  
> **username_2**: This will only work if your first url segment is 'index' so when your url is `www.example.com/index` it won't work for `www.example.com`. Do you have different templates for you first page and for the rest of them?  
> **username_0**: @RobinSchambach I have a _layout.html include on the index page and within layout is navigation.html  
> **username_2**: This doesn't answer my question. Do you use the template you use for your `index` page for any other page?  
> **username_0**: @RobinSchambach Yes, It's my main _layout file, it's included on every page.  
> **username_2**: I don't mean your layout file... When you set a bool variable to true in your index template and ask in your layout if the variable is defined and true. Would that work or do you use your index template for other entries too?  

---

## 1 answers

### Answer by username_3 on 2018-02-26. Score: 2 | Accepted answer

You can check against the Entry Type as well. 
I would try to validate it with something like:
{% set exclusions = ['home'] %}    
{% if entry.type not in exclusions %}
....


---

