<p>Templates or folder with an underscore are private and can't be accessed via template routing. Remove the <code>_</code> and you are fine. For example <code>news/entry</code> instead of <code>news/_entry</code></p>

CC BY-SA 4.0
2019-03-13T20:43:48.023Z
Then why is `_entry` used in the tutorial?
BBaysinger
CC BY-SA 4.0
2019-03-13T20:44:49.237Z
Usually because those templates are not meant to be exposed to public routing. I usually never create public templates and keep all of them private
Robin Schambach
CC BY-SA 4.0
2019-03-13T20:46:17.493Z
In the tutorial, those are public pages... I'm not understanding why it works there, but not for me.
BBaysinger
CC BY-SA 4.0
2019-03-13T20:47:22.030Z
Im sure they are not public. Otherwise they would not contain an underscore. Especially for seo purposes it makes no sense to have an url `news/_entry` those routes are usually only meant to be accessed via entry routes
Robin Schambach
CC BY-SA 4.0
2019-03-13T20:49:48.637Z
In the tutorial, the route to the about page is just `about/`, and in the templates folder, the file is `about/_entry.twig`... Are you saying I should do it differently than the tutorial?
BBaysinger
CC BY-SA 4.0
2019-03-13T20:53:13.087Z
I never watched the tutorial but I'm pretty sure you misunderstood something. As you can see here https://docs.craftcms.com/v3/routing.html. The course probably talks about element request, not about template routing
Robin Schambach
CC BY-SA 4.0
2019-03-13T21:04:54.913Z
https://docs.craftcms.com/v3/dev/#hidden-templates explains that we DO want the file to be hidden and with an underscore, and shows that it is accessible through the route like `about/` or `news/`
BBaysinger
CC BY-SA 4.0
2019-03-13T21:08:22.377Z
Well that paragraph explains exactly what I said. Those files can't be accessed via template routes only via element routing cause they are hidden and not public. So unless you have an element  that routes to this template it won't be triggert - and that's element routing
Robin Schambach
CC BY-SA 4.0
2019-03-13T21:32:23.873Z
So I guess then my question is why is my element routing not working.
BBaysinger
CC BY-SA 4.0
2019-03-13T21:45:06.097Z
You might've missed the part where we created a Structure section (called About) for the pages and use the templates to render this entries. If you create a new entry in the Structure section called "About" and then a child entry under it called "Locations" then you should be able to access the template via about/locations.
CraftQuest
CC BY-SA 4.0
2019-03-13T21:45:15.447Z
Impossible to say without knowing your Uri structure and without your element slug
Robin Schambach
CC BY-SA 4.0
2019-03-13T21:58:46.943Z
Oh, it looks like I got it. I missed the part where the slug for the About entry was changed... Thanks for all your help, guys.
BBaysinger
CC BY-SA 4.0
2019-03-13T20:41:52.143Z
2019-03-13T20:41:52.143Z
Robin Schambach
<p>I haven't seen the video but just reading you I think that he may be using a layout file in the tutorial and use the <code>_templates</code> as includes. So inside a master template:</p>

<pre><code>{% include "about/_entry" %}
</code></pre>

<p>Or... if you have <code>index.twig</code> with:</p>

<pre class="lang-twig prettyprint-override"><code>&lt;!doctype html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
    ...
&lt;/head&gt;
&lt;body&gt;
    &lt;h1&gt;Your site&lt;/h1&gt;
    {% block content %}
        &lt;p&gt;You shouldn't see me&lt;/p&gt;
    {% endblock %}
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>And <code>about/_entry.twig</code> with:</p>

<pre class="lang-twig prettyprint-override"><code>{% block content %}
    Hello or {{entry.title}} if you have content in there
{% endblock %}
</code></pre>

<p>That would work also... I may also be reading you completely wrong :)</p>

CC BY-SA 4.0
2019-03-13T22:18:50.990Z
2019-03-13T22:48:18.897Z
2019-03-13T22:48:18.897Z
Oli
<p>I problem was that I missed the part where the slug for the About Craft Coffee entry was changed. In video 26, Creating a Structure Section, at 2:58, the slug <code>about-crafty-coffee</code> was changed to just <code>about</code>. He did it real quick, and I had to go back and watch the whole video to notice that. I should have rewatched it sooner. So that's why my element routing was not working; there wasn't an entry that matched the slug, because I hadn't changed mine.</p>

CC BY-SA 4.0
2019-03-14T16:09:52.133Z
2019-03-14T16:41:27.820Z
2019-03-14T16:41:27.820Z
BBaysinger
<p>Following the Minjingo CraftQuest tutorial, I am getting an error on the front end when I access any routes other than the root/home page.</p>

<p>In my template folder, I have a structure that looks like:</p>

<pre><code>templates/
├── index.twig
├── about/
│   └── _entry.twig
├── drinks/
│   └── _entry.twig
└── news/
    └── _entry.twig
</code></pre>

<p>In my about section settings, my template is <code>about/_entry</code>, as it is in the tutorial.</p>

<p>The error I get is:</p>

<blockquote>
<pre><code>HTTP 404 – Not Found – yii\web\NotFoundHttpException
Template not found: about
</code></pre>
</blockquote>

<p>Maybe I missed a step? What should I look for?</p>

<templating><error>
404 – Not Found from _entry.twig templates in subdirectories
# 404 – Not Found from _entry.twig templates in subdirectories

(Asked by: username_0 on 2019-03-13)

Following the Minjingo username_2 tutorial, I am getting an error on the front end when I access any routes other than the root/home page.
In my template folder, I have a structure that looks like:
templates/
├── index.twig
├── about/
│   └── _entry.twig
├── drinks/
│   └── _entry.twig
└── news/
    └── _entry.twig

In my about section settings, my template is about/_entry, as it is in the tutorial.
The error I get is:

HTTP 404 – Not Found – yii\web\NotFoundHttpException
Template not found: about


Maybe I missed a step? What should I look for?

**Tags:** templating, error


---

## 3 answers

### Answer by username_1 on 2019-03-13. Score: 2

Templates or folder with an underscore are private and can't be accessed via template routing. Remove the `_` and you are fine. For example `news/entry` instead of `news/_entry`

> **Comments:**
> **username_0**: Then why is `_entry` used in the tutorial?  
> **username_1**: Usually because those templates are not meant to be exposed to public routing. I usually never create public templates and keep all of them private  
> **username_0**: In the tutorial, those are public pages... I'm not understanding why it works there, but not for me.  
> **username_1**: Im sure they are not public. Otherwise they would not contain an underscore. Especially for seo purposes it makes no sense to have an url `news/_entry` those routes are usually only meant to be accessed via entry routes  
> **username_0**: In the tutorial, the route to the about page is just `about/`, and in the templates folder, the file is `about/_entry.twig`... Are you saying I should do it differently than the tutorial?  
> **username_1**: I never watched the tutorial but I'm pretty sure you misunderstood something. As you can see here https://docs.craftcms.com/v3/routing.html. The course probably talks about element request, not about template routing  
> **username_0**: https://docs.craftcms.com/v3/dev/#hidden-templates explains that we DO want the file to be hidden and with an underscore, and shows that it is accessible through the route like `about/` or `news/`  
> **username_1**: Well that paragraph explains exactly what I said. Those files can't be accessed via template routes only via element routing cause they are hidden and not public. So unless you have an element  that routes to this template it won't be triggert - and that's element routing  
> **username_0**: So I guess then my question is why is my element routing not working.  
> **username_2**: You might've missed the part where we created a Structure section (called About) for the pages and use the templates to render this entries. If you create a new entry in the Structure section called "About" and then a child entry under it called "Locations" then you should be able to access the template via about/locations.  
> **username_1**: Impossible to say without knowing your Uri structure and without your element slug  
> **username_0**: Oh, it looks like I got it. I missed the part where the slug for the About entry was changed... Thanks for all your help, guys.  

---

### Answer by username_3 on 2019-03-13. Score: 1

I haven't seen the video but just reading you I think that he may be using a layout file in the tutorial and use the _templates as includes. So inside a master template:
{% include "about/_entry" %}

Or... if you have index.twig with:



    ...


    Your site
    {% block content %}
        You shouldn't see me
    {% endblock %}



And about/_entry.twig with:
{% block content %}
    Hello or {{entry.title}} if you have content in there
{% endblock %}

That would work also... I may also be reading you completely wrong :)


---

### Answer by username_0 on 2019-03-14. Score: 0

I problem was that I missed the part where the slug for the About Craft Coffee entry was changed. In video 26, Creating a Structure Section, at 2:58, the slug `about-crafty-coffee` was changed to just `about`. He did it real quick, and I had to go back and watch the whole video to notice that. I should have rewatched it sooner. So that's why my element routing was not working; there wasn't an entry that matched the slug, because I hadn't changed mine.


---

