Answers.Body: <p>Try this - using {{ entry.section }} and {{ entry.slug }}</p>
  
  <pre><code>{% for row in entry.homeFeaturedProducts.order('RAND()')|batch(4) %}
  {% for entry in row %}
      &lt;h2 class="product-card-title"&gt;&lt;a href="{{ entry.section}}/{{ entry.slug }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/h2&gt;
      &lt;span class="product-card-desc"&gt;Product Description&lt;/span&gt;
      &lt;span class="product-card-price"&gt;{{ entry.price }}&lt;/span&gt;
  {% endfor %}        
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-21T20:37:38.317Z
Answers.Text: Thanks, that does indeed work, but I now need to get the template to match with the url as the slug consists of 2 parts (which is what I wanted) and using an entry-type template which matches the section is throwing a 404:
  
  entry type handle is 'products'
  
  and the template name is also 'products' which works for urls with one slug but not for the additional as desired?
Answers.UserDisplayName: Kev N
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-21T20:48:22.190Z
Answers.Text: I just changed the section url format setting to:
  
  {section}/{slug}
  
  and sorted
Answers.UserDisplayName: Kev N
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-21T13:55:23.617Z
Answers.LastActivityDate: 2018-02-21T13:55:23.617Z
Answers.UserDisplayName: CreateSean
Body: <p>I would like to add the URL of the channel entry I have selected (atm 2 channels are available to choose from), so I would like a url like:</p>
  
  <p><strong>summerhouses</strong>/product1</p>
  
  <p>or</p>
  
  <p><strong>greehnouses</strong>/product2</p>
  
  <p>how would I modify the code below to achieve this? </p>
  
  <p>The code below just shows: /product1</p>
  
  <pre><code>{% for row in entry.homeFeaturedProducts.order('RAND()')|batch(4) %}
  {% for entry in row %}
      &lt;h2 class="product-card-title"&gt;&lt;a href="{{ entry.getUrl }}"&gt;{{ entry.title }}&lt;/a&gt;&lt;/h2&gt;
      &lt;span class="product-card-desc"&gt;Product Description&lt;/span&gt;
      &lt;span class="product-card-price"&gt;{{ entry.price }}&lt;/span&gt;
  {% endfor %}        
  {% endfor %}
  </code></pre>
  
Tags: <entry><url><relatedto>
Title: Include the URL of a related entry field
ThreadText: # Include the URL of a related entry field
  
  (Asked by: username_0 on 2018-02-21)
  
  I would like to add the URL of the channel entry I have selected (atm 2 channels are available to choose from), so I would like a url like:
  
  **summerhouses**/product1
  
  or
  
  **greehnouses**/product2
  
  how would I modify the code below to achieve this?
  
  The code below just shows: /product1
  
  ```
  {% for row in entry.homeFeaturedProducts.order('RAND()')|batch(4) %}
  {% for entry in row %}
      <h2 class="product-card-title"><a href="{{ entry.getUrl }}">{{ entry.title }}</a></h2>
      <span class="product-card-desc">Product Description</span>
      <span class="product-card-price">{{ entry.price }}</span>
  {% endfor %}        
  {% endfor %}
  
  ```
  
  **Tags:** entry, url, relatedto
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-02-21. Score: 1 | Accepted answer
  
  Try this - using {{ entry.section }} and {{ entry.slug }}
  
  ```
  {% for row in entry.homeFeaturedProducts.order('RAND()')|batch(4) %}
  {% for entry in row %}
      <h2 class="product-card-title"><a href="{{ entry.section}}/{{ entry.slug }}">{{ entry.title }}</a></h2>
      <span class="product-card-desc">Product Description</span>
      <span class="product-card-price">{{ entry.price }}</span>
  {% endfor %}        
  {% endfor %}
  
  ```
  
  > **Comments:**
  > **username_0**: Thanks, that does indeed work, but I now need to get the template to match with the url as the slug consists of 2 parts (which is what I wanted) and using an entry-type template which matches the section is throwing a 404:  entry type handle is 'products'  and the template name is also 'products' which works for urls with one slug but not for the additional as desired?  
  > **username_0**: I just changed the section url format setting to:  {section}/{slug}  and sorted  
  
  ---
  
  