<p>I'm not completely sure about what you're asking, but you might want to look in to craft.request:
 <a href="https://craftcms.com/docs/templating/craft.request" rel="nofollow noreferrer">https://craftcms.com/docs/templating/craft.request</a></p>

<p>In your structure template, you can check your URL segments, and use twig include to load the desired template, based on those segments. </p>

<p>Another related feature is dynamic routing:
<a href="https://craftcms.com/docs/routing#dynamic-routes" rel="nofollow noreferrer">https://craftcms.com/docs/routing#dynamic-routes</a></p>

<p>You could use this to route a URL to a different template. </p>

CC BY-SA 3.0
2017-08-14T21:01:14.113Z
I tried to get crafty.request to work but without any luck. Ended up setting up a route. Not sure if this is really the proper way to do it but I got it to work.

`artists/(slug)/(slug)/(slug)/thumb` loads `artists/_types/thumb.html` template
SoHo
CC BY-SA 3.0
2017-08-13T11:49:08.817Z
2017-08-13T11:49:08.817Z
Youniteus
<p>I have 3 level structure for my entries with separate template for each level.</p>

<p><code>/artists/artist-name/</code> uses <code>artists/_types/artists.html</code> template</p>

<p><code>/artists/artist-name/section-name/</code> uses <code>artists/_types/section.html</code> template</p>

<p><code>/artists/artist-name/section-name/project-name/</code> uses <code>artists/_types/project.html</code> template</p>

<p>What I need to do is to specify additional layout for level 3 entry so depending on URI I can display one or another.</p>

<p>This is the additional URI I want to use:
<code>/artists/artist-name/section-name/project-name/thumb</code> and I want to load the <code>artists/_types/thumb.html</code> template</p>

<templating><routes><routing>
Specify which template/layout to use based on URI segment
# Specify which template/layout to use based on URI segment

(Asked by: username_0 on 2017-08-11)

I have 3 level structure for my entries with separate template for each level.

`/artists/artist-name/` uses `artists/_types/artists.html` template

`/artists/artist-name/section-name/` uses `artists/_types/section.html` template

`/artists/artist-name/section-name/project-name/` uses `artists/_types/project.html` template

What I need to do is to specify additional layout for level 3 entry so depending on URI I can display one or another.

This is the additional URI I want to use:
`/artists/artist-name/section-name/project-name/thumb` and I want to load the `artists/_types/thumb.html` template

**Tags:** templating, routes, routing

---

## 1 answers

### Answer by username_1 on 2017-08-13. Score: 1 | Accepted answer

I'm not completely sure about what you're asking, but you might want to look in to craft.request:
<https://craftcms.com/docs/templating/craft.request>

In your structure template, you can check your URL segments, and use twig include to load the desired template, based on those segments.

Another related feature is dynamic routing:
<https://craftcms.com/docs/routing#dynamic-routes>

You could use this to route a URL to a different template.

> **Comments:**
> **username_0**: I tried to get crafty.request to work but without any luck. Ended up setting up a route. Not sure if this is really the proper way to do it but I got it to work.  `artists/(slug)/(slug)/(slug)/thumb` loads `artists/_types/thumb.html` template  

---

