<p>I think the problem here could be to do with the path to your Category Template.</p>

<p>Make sure that in your category settings, the path to your Category Template file includes the folder it is nested within.</p>

<p>So instead of <code>_category.html</code>, you should put <code>blog/_category.html</code> (if that file is inside the Blog template folder)</p>

<p>There is also some <a href="http://buildwithcraft.com/help/entries-related-to-category" rel="nofollow">docs</a> on the Craft site that tells you how to template this file if you haven't seen it already.</p>

CC BY-SA 3.0
2014-10-14T09:22:08.697Z
2014-10-14T20:27:36.267Z
2014-10-14T20:27:36.267Z
Jamie Wade
<p>I'm building a simple blog that has the ability to publish entries:</p>

<ul>
<li>Within a set of categories.</li>
<li>With no category set.</li>
</ul>

<p>The URL format of a blog entry is <code>/blog/YYYY/MM/DD/{slug}</code></p>

<p>Everything so far works, my section <code>blog</code> works and the <code>templates/blog/index.html</code> template loads correctly as does the <code>templates/blog/_entry.html</code> for blog entries.</p>

<p>Categories however don't seem to work as they seem to be conflicting with the entry URLs… I have a list of all blog categories at the top of the blog section with each section, eg: 'Recipes', linking to <code>/blog/recipes</code> (using the <code>{category.url}</code> var).</p>

<p>In Craft I have set the Blog categories settings set to:</p>

<ul>
<li><strong>Category URL Format</strong>: <code>blog/{slug}</code></li>
<li><strong>Nested Categories</strong>: <em>not set/empty</em></li>
<li><strong>Category Template</strong>: <code>_category.html</code> <em>(I have also tried <code>_category</code> without the <code>.html</code> extension as the value with the same result)</em></li>
</ul>

<p><strong>The issue</strong> is that when I navigate to <code>blog/recipes</code> I get a 404 instead of the system serving the <code>templates/blog/_category.html</code> template I have set up.</p>

<p>Note: There are no custom routes setup for this site.</p>

<p>I'm not sure what I am doing wrong, single entries serve up fine, but I can't seem to get to the category listing of a blog's category.</p>

<p>Any help would be much appreciated.</p>

<templating><entries><url><categories><routes>
How can I get blog categories and blog entry urls to play nice together?
# How can I get blog categories and blog entry urls to play nice together?

(Asked by: username_0 on 2014-10-14)

I'm building a simple blog that has the ability to publish entries:

* Within a set of categories.
* With no category set.

The URL format of a blog entry is `/blog/YYYY/MM/DD/{slug}`

Everything so far works, my section `blog` works and the `templates/blog/index.html` template loads correctly as does the `templates/blog/_entry.html` for blog entries.

Categories however don't seem to work as they seem to be conflicting with the entry URLs… I have a list of all blog categories at the top of the blog section with each section, eg: 'Recipes', linking to `/blog/recipes` (using the `{category.url}` var).

In Craft I have set the Blog categories settings set to:

* **Category URL Format**: `blog/{slug}`
* **Nested Categories**: *not set/empty*
* **Category Template**: `_category.html` *(I have also tried `_category` without the `.html` extension as the value with the same result)*

**The issue** is that when I navigate to `blog/recipes` I get a 404 instead of the system serving the `templates/blog/_category.html` template I have set up.

Note: There are no custom routes setup for this site.

I'm not sure what I am doing wrong, single entries serve up fine, but I can't seem to get to the category listing of a blog's category.

Any help would be much appreciated.

**Tags:** templating, entries, url, categories, routes

---

## 1 answers

### Answer by username_1 on 2014-10-14. Score: 3 | Accepted answer

I think the problem here could be to do with the path to your Category Template.

Make sure that in your category settings, the path to your Category Template file includes the folder it is nested within.

So instead of `_category.html`, you should put `blog/_category.html` (if that file is inside the Blog template folder)

There is also some [docs](http://buildwithcraft.com/help/entries-related-to-category) on the Craft site that tells you how to template this file if you haven't seen it already.


---

