Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-02T09:23:58.293Z
Answers.Text: Seems obvious now - thanks Luke that was it.
Answers.UserDisplayName: joomkit
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-02T07:55:22.017Z
Answers.LastActivityDate: 2016-08-02T07:55:22.017Z
Answers.UserDisplayName: Luke Pearce
Body: <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>
  
Tags: <routing><category>
Title: Top level entry url not rendering category in url
ThreadText: # 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 username_1 that was it.  
  
  ---
  
  