<p>You know you can do things like this in your root entry  template to load it dynamically based on slug or entry type </p>

<pre><code>{% extends [
  'pages/_custom/' ~ page.slug ~ '.twig',
  'pages/_entrytypes/' ~ page.type ~ '.twig',
  'pages/_generic.twig' ]
%}
</code></pre>

CC BY-SA 3.0
2018-01-12T17:44:09.340Z
2018-01-12T17:44:09.340Z
Robin Schambach
<p>What does each line actually do assuming thats in _entry.twig?
and assuming the templates reside in the /pages directory? A brief overview of the functionality would be invaluable :)</p>

CC BY-SA 3.0
2018-01-15T11:52:30.863Z
Say that you have an entry with the type `page` and the slug `slug`. It would first try to load `pages/_custom/slug.twig` - if that doesn't exist it would try to load `pages/_entrytypes/page.twig` - and, finally, it would fall back to `pages/_generic.twig`
Fuglsetrampen
CC BY-SA 3.0
2018-01-12T21:02:55.750Z
2018-01-12T21:02:55.750Z
Kev N
<p>I'm using a route to use a different template, but whatever I try the page remains unchanged, my structure is set as:</p>

<p>entry url format: {slug}</p>

<p>entry template: _pages/_entry</p>

<p>I want an entry's slug to use a different template - would this possibly be affecting the route being followed?</p>

<p>I want the entry 'home' to use the 'index' template (and not the '_home' template which exists at _pages/_home)</p>

<p>I've cleared my cache and updated indexes</p>

CC BY-SA 3.0
2018-01-12T17:05:03.527Z
I used {% redirect "/" %}

will think of a better way, but for parent entries in a structure where they are just used for the structure and need no content, e.g. 

ABOUT (no content)
team
history

is there a way of redirecting say ABOUT to team?
user2569
<structure><routing>
Can you use Routes on Structure entries
# Can you use Routes on Structure entries

(Asked by: username_0 on 2018-01-12)

I'm using a route to use a different template, but whatever I try the page remains unchanged, my structure is set as:

entry url format: {slug}

entry template: \_pages/\_entry

I want an entry's slug to use a different template - would this possibly be affecting the route being followed?

I want the entry 'home' to use the 'index' template (and not the '\_home' template which exists at \_pages/\_home)

I've cleared my cache and updated indexes

**Tags:** structure, routing
> **Comments:**
> **username_0**: I used {% redirect "/" %}  will think of a better way, but for parent entries in a structure where they are just used for the structure and need no content, e.g.   ABOUT (no content) team history  is there a way of redirecting say ABOUT to team?  

---

## 2 answers

### Answer by username_1 on 2018-01-12. Score: 1 | Accepted answer

You know you can do things like this in your root entry  template to load it dynamically based on slug or entry type 
{% extends [
  'pages/_custom/' ~ page.slug ~ '.twig',
  'pages/_entrytypes/' ~ page.type ~ '.twig',
  'pages/_generic.twig' ]
%}


---

### Answer by username_2 on 2018-01-12. Score: 0

What does each line actually do assuming thats in \_entry.twig?
and assuming the templates reside in the /pages directory? A brief overview of the functionality would be invaluable :)

> **Comments:**
> **username_3**: Say that you have an entry with the type `page` and the slug `slug`. It would first try to load `pages/_custom/slug.twig` - if that doesn't exist it would try to load `pages/_entrytypes/page.twig` - and, finally, it would fall back to `pages/_generic.twig`  

---

