Answers.Body: <p>If your entries field is in the layout of your category</p>
  
  <pre class="lang-TWIG prettyprint-override"><code>{% if object.level == 1 %}
      {% set entry = object.entriesFieldHandle.one() %}
      {slug}-{{ entry? entry.slug : '' }}
  {% else %}
      {slug}-{parent.uri}
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-10T19:38:43.873Z
Answers.Text: The entries field is in layout of the entry itself where the category assigned to.
Answers.UserDisplayName: Mark H.
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-10T19:39:38.223Z
Answers.Text: I would highly suggest to not that if you care a little bit about SEO then
Answers.UserDisplayName: Robin Schambach
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-10T19:59:02.527Z
Answers.Text: Still looking for solution.
Answers.UserDisplayName: Mark H.
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-10T20:00:13.580Z
Answers.Text: Then grab the entry that is related to your category `{% set entry = craft.entries.relatedaTo(object).one() %}` but keep in mind this will always a different one so your url will always change
Answers.UserDisplayName: Robin Schambach
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-10T18:31:35.500Z
Answers.LastActivityDate: 2019-03-10T18:31:35.500Z
Answers.UserDisplayName: Robin Schambach
Body: <p>Is there a way to pass value of an entries field into category URI format?</p>
  
  <pre><code>{% if object.level == 1 %}
  
  {slug}-{entries.one().slug}
  
  {% else %}
  
  {slug}-{parent.uri}
  
  {% endif %}
  </code></pre>
  
  <p>Thanks.</p>
  
Tags: <url>
Title: Entries field in categories URI
ThreadText: # Entries field in categories URI
  
  (Asked by: username_0 on 2019-03-10)
  
  Is there a way to pass value of an entries field into category URI format?
  
  ```
  {% if object.level == 1 %}
  
  {slug}-{entries.one().slug}
  
  {% else %}
  
  {slug}-{parent.uri}
  
  {% endif %}
  
  ```
  
  Thanks.
  
  **Tags:** url
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-03-10. Score: 2
  
  If your entries field is in the layout of your category
  
  ```TWIG
  {% if object.level == 1 %}
      {% set entry = object.entriesFieldHandle.one() %}
      {slug}-{{ entry? entry.slug : '' }}
  {% else %}
      {slug}-{parent.uri}
  {% endif %}
  
  ```
  
  > **Comments:**
  > **username_0**: The entries field is in layout of the entry itself where the category assigned to.  
  > **username_1**: I would highly suggest to not that if you care a little bit about SEO then  
  > **username_0**: Still looking for solution.  
  > **username_1**: Then grab the entry that is related to your category `{% set entry = craft.entries.relatedaTo(object).one() %}` but keep in mind this will always a different one so your url will always change  
  
  ---
  
  