<p>Building off of Marco's first answer:</p>

<p>In your case, perhaps the easiest approach is to have a conditional in your Structure's entry template that checks the entry's <code>level</code> property, and includes different templates based on that - i.e. if the entry's <code>level</code> is 1, that means the entry is top level, and Craft should load an overview template. If not, the single service template should be served.</p>

<p>Something like this should do the trick – I'm assuming you have a template folder called "services", with three templates: index.html (which is the Structure's entry template), overview.html and service.html, and the following would go inside the entry template:</p>

<pre><code>{% if entry.level == 1 %}
    {% include 'services/overview' %}
{% else %}
    {% include 'services/service' %}
{% endif %}
</code></pre>

<p>Note that with this setup, you can just put "services" (without the quotes) for your Structure Section's Entry Template field; then Craft will load the "services/index.html" template whenever an entry from this Structure is requested, and the above conditional will make sure the correct template is served.</p>

<p>Another approach entirely is to create a dropdown field (called <code>structureTemplate</code> or the like) for your Structure, which is hard coded to the following values:</p>

<pre><code>service : Service template
overview : Service overview template
</code></pre>

<p>This would enable you to select the template on an entry basis. Here's how you could handle this in your entry template:</p>

<pre><code>{% set template = entry.structureTemplate|default('service') %}
{% include 'services/'~template %}
</code></pre>

<p>I really think the first approach is better for your use case, though – considering that top level entries should always load one template and child level entries should always load another.</p>

CC BY-SA 3.0
2016-03-02T10:32:15.960Z
2016-03-02T10:55:55.770Z
2016-03-02T10:55:55.770Z
Mats Mikkel Rummelhoff
<p>I just noticed something.</p>

<p>"Onze Diensten" is your structure. In this structure you made an entry "Onze Diensten" on the first structure level.</p>

<p>If this "Onze Diensten" entry only is an overview of all it's children entries and doesn't contain any extra content you could just remove the "Onze Diensten" entry and make all the children entries on the first structure level.</p>

<p>For the overview page you would load the index.html with some code like this:</p>

<pre><code>{% for entry in craft.entries.section('onzeDiensten') %}
  &lt;a href={{entry.url}}&gt;{{entry.title}}&lt;/a&gt;
{% endfor %}
</code></pre>

CC BY-SA 3.0
2016-03-02T10:07:56.967Z
I need "Onze Diensten" To be an entry on it's own for the navigation plugin that I use. Otherwise I can't make a submenu with children in it.
Jeffrey Stevens
CC BY-SA 3.0
2016-03-02T09:37:15.140Z
2016-03-02T09:37:15.140Z
Marco Schuler
<p>I can't answer it clearly, but I did a workaround for something similar.</p>

<p>I've loaded the same template for my structure but gave my structure 2 entry-types(overviewPage, detailPage).</p>

<p>Both entry types loaded the same template but got handled differently. So my template for the structure looked something like this:</p>

<pre><code>{% if entry.type == 'overviewPage' %}
  {% include 'snippets/content_overviewPage.html' %}
{% elseif entry.type == 'detailPage' %}
  {% include 'snippets/content_detailPage.html' %}
{% endif %}
</code></pre>

<p>I hope to see on this thread how other people handle this.</p>

CC BY-SA 3.0
2016-03-02T08:46:46.470Z
Thanks for your input! This explanation I can understand I also saw another thread on the same issue I believe and apparently someone gave a very good solution. But I don't understand what he did probably because I am still new at Craft. But maybe it can help you so here is [the link.] (http://craftcms.stackexchange.com/questions/96/how-can-i-route-a-specific-entry-in-a-structure-section-to-its-own-template)
Jeffrey Stevens
CC BY-SA 3.0
2016-03-02T09:13:49.550Z
But how do you give different handles to the same structure? My structure handle is onzeDiensten and all the child structures get the same handle.
Which means that I can use {% if entry.type == 'onzeDiensten' %} but I can't make use of the elseif beneath it because all the structures have the handle of onzeDiensten.
Jeffrey Stevens
CC BY-SA 3.0
2016-03-02T09:23:34.763Z
Make sure to define a second entry.type in your structure.
And add this new entry.type you your entries. 
You can than handle those entries depending on their entry.type.
Marco Schuler
CC BY-SA 3.0
2016-03-02T11:07:00.670Z
Marco, you are a genius. It works. I tried it failed a couple of times but eventually it worked out great! So thank you so much now I can finally move on with my project.
Jeffrey Stevens
CC BY-SA 3.0
2016-03-02T08:41:25.820Z
2016-03-02T08:41:25.820Z
Marco Schuler
<p>I wondered if it is possible to use one specific template for just one structure.</p>

<p><a href="https://i.sstatic.net/M2fpY.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/M2fpY.png" alt="My structure build up"></a></p>

<p>So let me make this clear. I have a structure called "Onze Diensten" (Our Services) and inside are child structures that are the actual services that the website offers. These child structures use a template that I assigned to them through structure so that works perfectly. 
But what I want now is that the actual "Onze Diensten" gets it's own individual template which would show all the services on one page.</p>

<p>How do I do that?
Thank you for taking the time reading my question.</p>

<p>What I hoped would be the solution is using routes. By adding a route that when you visit onze-diensten/ it would load up the template onze-diensten/onze-diensten/ (Which is the path to the template I want to use).</p>

<p>But it seems to completely ignore the route at all.</p>

<templating><structure>
Specific template for a structure
# Specific template for a structure

(Asked by: username_0 on 2016-03-02)

I wondered if it is possible to use one specific template for just one structure.

[![My structure build up](https://i.sstatic.net/M2fpY.png)](https://i.sstatic.net/M2fpY.png)

So let me make this clear. I have a structure called "Onze Diensten" (Our Services) and inside are child structures that are the actual services that the website offers. These child structures use a template that I assigned to them through structure so that works perfectly.
But what I want now is that the actual "Onze Diensten" gets it's own individual template which would show all the services on one page.

How do I do that?
Thank you for taking the time reading my question.

What I hoped would be the solution is using routes. By adding a route that when you visit onze-diensten/ it would load up the template onze-diensten/onze-diensten/ (Which is the path to the template I want to use).

But it seems to completely ignore the route at all.

**Tags:** templating, structure


---

## 3 answers

### Answer by username_2 on 2016-03-02. Score: 4 | Accepted answer

I can't answer it clearly, but I did a workaround for something similar.
I've loaded the same template for my structure but gave my structure 2 entry-types(overviewPage, detailPage).
Both entry types loaded the same template but got handled differently. So my template for the structure looked something like this:
{% if entry.type == 'overviewPage' %}
  {% include 'snippets/content_overviewPage.html' %}
{% elseif entry.type == 'detailPage' %}
  {% include 'snippets/content_detailPage.html' %}
{% endif %}

I hope to see on this thread how other people handle this.

> **Comments:**
> **username_0**: Thanks for your input! This explanation I can understand I also saw another thread on the same issue I believe and apparently someone gave a very good solution. But I don't understand what he did probably because I am still new at Craft. But maybe it can help you so here is [the link.] (http://craftcms.stackexchange.com/questions/96/how-can-i-route-a-specific-entry-in-a-structure-section-to-its-own-template)  
> **username_0**: But how do you give different handles to the same structure? My structure handle is onzeDiensten and all the child structures get the same handle. Which means that I can use {% if entry.type == 'onzeDiensten' %} but I can't make use of the elseif beneath it because all the structures have the handle of onzeDiensten.  
> **username_2**: Make sure to define a second entry.type in your structure. And add this new entry.type you your entries.  You can than handle those entries depending on their entry.type.  
> **username_0**: Marco, you are a genius. It works. I tried it failed a couple of times but eventually it worked out great! So thank you so much now I can finally move on with my project.  

---

### Answer by username_1 on 2016-03-02. Score: 3

Building off of Marco's first answer:
In your case, perhaps the easiest approach is to have a conditional in your Structure's entry template that checks the entry's level property, and includes different templates based on that - i.e. if the entry's level is 1, that means the entry is top level, and Craft should load an overview template. If not, the single service template should be served.
Something like this should do the trick – I'm assuming you have a template folder called "services", with three templates: index.html (which is the Structure's entry template), overview.html and service.html, and the following would go inside the entry template:
{% if entry.level == 1 %}
    {% include 'services/overview' %}
{% else %}
    {% include 'services/service' %}
{% endif %}

Note that with this setup, you can just put "services" (without the quotes) for your Structure Section's Entry Template field; then Craft will load the "services/index.html" template whenever an entry from this Structure is requested, and the above conditional will make sure the correct template is served.
Another approach entirely is to create a dropdown field (called structureTemplate or the like) for your Structure, which is hard coded to the following values:
service : Service template
overview : Service overview template

This would enable you to select the template on an entry basis. Here's how you could handle this in your entry template:
{% set template = entry.structureTemplate|default('service') %}
{% include 'services/'~template %}

I really think the first approach is better for your use case, though – considering that top level entries should always load one template and child level entries should always load another.


---

### Answer by username_2 on 2016-03-02. Score: 2

I just noticed something.
"Onze Diensten" is your structure. In this structure you made an entry "Onze Diensten" on the first structure level.
If this "Onze Diensten" entry only is an overview of all it's children entries and doesn't contain any extra content you could just remove the "Onze Diensten" entry and make all the children entries on the first structure level.
For the overview page you would load the index.html with some code like this:
{% for entry in craft.entries.section('onzeDiensten') %}
  {{entry.title}}
{% endfor %}

> **Comments:**
> **username_0**: I need "Onze Diensten" To be an entry on it's own for the navigation plugin that I use. Otherwise I can't make a submenu with children in it.  

---

