<p>I imagine it's because you're trying to access <code>productCategory</code> on <code>category</code> instead of the <code>entry</code>. When you're setting entry urls you don't need to use the <code>entry</code> prefix as it automatically expects this to be the case. So try <code>products{productCategory.first().slug}/{slug}</code></p>

CC BY-SA 3.0
2016-08-02T09:23:58.293Z
Seems obvious now - thanks Luke that was it.
joomkit
CC BY-SA 3.0
2016-08-02T07:55:22.017Z
2016-08-02T07:55:22.017Z
Luke Pearce
<p>I have a structure section called products. The entry url format is</p>

<pre><code>products{category.productCategory.first().slug}/{slug}
</code></pre>

<p>However the category never shows in the preview or real world url (real world url gives a 404)</p>

<p>Each product entry only has one category so am puzzled as to why the category doesn't appear in the url.</p>

<routing><category>
Top level entry url not rendering category in url
# Top level entry url not rendering category in url

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

I have a structure section called products. The entry url format is
products{category.productCategory.first().slug}/{slug}

However the category never shows in the preview or real world url (real world url gives a 404)
Each product entry only has one category so am puzzled as to why the category doesn't appear in the url.

**Tags:** routing, category

---

## 1 answers

### Answer by username_1 on 2016-08-02. Score: 2 | Accepted answer

I imagine it's because you're trying to access `productCategory` on `category` instead of the `entry`. When you're setting entry urls you don't need to use the `entry` prefix as it automatically expects this to be the case. So try `products{productCategory.first().slug}/{slug}`

> **Comments:**
> **username_0**: Seems obvious now - thanks Luke that was it.  

---

