<p>To expand on my comment you could do this:</p>

<p>In <code>templates/_pages/index.twig</code> you would do:</p>

<p><code>{% include '_pages/_types/_' ~ entry.type %}</code></p>

<p>Then create a folder in <code>/templates/_pages/</code> called <code>_types</code> in it use, an example <code>_standard.twig</code> in which "standard" coincides to your Entry Type slug.</p>

<p>I hope that helps. I couldn't find the original SE post but I know that this method has been mentioned and preferred by many Crafters!</p>

CC BY-SA 3.0
2016-08-30T15:57:05.433Z
2016-08-30T15:57:05.433Z
Mark Busnelli Jr
<p>What i want do is:</p>

<p>I will get all level 1 childs from the current Section to build a Subnav with it. Like:</p>

<p><code>{% set pages = craft.entries.section(getCurrentSection).level(1) %}</code></p>

<p>What i need to know is the current section handle. Thank you ;)</p>

CC BY-SA 3.0
2016-09-02T15:16:18.187Z
You really should update your question, not answering it in this way.
Mark Busnelli Jr
CC BY-SA 3.0
2016-08-31T09:25:57.307Z
2016-08-31T09:25:57.307Z
The Frog
<p>I have a template which I want to use for different sections.</p>

<p>In my template I have this code:</p>

<pre><code>{% set pages = craft.entries.section('catering').level(1) %}
&lt;ul&gt;
  {% for page in pages %}
    &lt;li&gt;{{ page.getLink() }}&lt;/li&gt;
  {% endfor %}
&lt;/ul&gt;
</code></pre>

<p>But I want to select the current section by Craft self. So I can use the same template for multiple sections.</p>

CC BY-SA 3.0
2016-08-30T15:48:03.030Z
If you're using entry types to control your templates have a look at https://craftcms.com/support/entry-type-templates
Mark Busnelli Jr
CC BY-SA 3.0
2016-08-30T15:51:21.023Z
Hi Alex, I'm afraid I don't understand what you're asking. You can set the template for a section in the control panel. Maybe read through this article to get a grasp of it: http://withchief.com/blog/craft-cms-the-very-basics-of-templating
Luke Pearce
<navigation>
Get Level 1 entry on a section as Nav
# Get Level 1 entry on a section as Nav

(Asked by: username_0 on 2016-08-30)

I have a template which I want to use for different sections.
In my template I have this code:
{% set pages = craft.entries.section('catering').level(1) %}

  {% for page in pages %}
    {{ page.getLink() }}
  {% endfor %}


But I want to select the current section by Craft self. So I can use the same template for multiple sections.

**Tags:** navigation
> **Comments:**
> **username_1**: If you're using entry types to control your templates have a look at https://craftcms.com/support/entry-type-templates  
> **username_2**: Hi Alex, I'm afraid I don't understand what you're asking. You can set the template for a section in the control panel. Maybe read through this article to get a grasp of it: http://withchief.com/blog/craft-cms-the-very-basics-of-templating  

---

## 2 answers

### Answer by username_1 on 2016-08-30. Score: 2

To expand on my comment you could do this:

In `templates/_pages/index.twig` you would do:

`{% include '_pages/_types/_' ~ entry.type %}`

Then create a folder in `/templates/_pages/` called `_types` in it use, an example `_standard.twig` in which "standard" coincides to your Entry Type slug.

I hope that helps. I couldn't find the original SE post but I know that this method has been mentioned and preferred by many Crafters!


---

### Answer by username_0 on 2016-08-31. Score: 1

What i want do is:

I will get all level 1 childs from the current Section to build a Subnav with it. Like:

`{% set pages = craft.entries.section(getCurrentSection).level(1) %}`

What i need to know is the current section handle. Thank you ;)

> **Comments:**
> **username_1**: You really should update your question, not answering it in this way.  

---

