<p>Assuming your store/brand field handle in your new channel is <code>relatedEntryField</code>, set your URL format when you're defining the channel section to:</p>

<pre><code>{relatedEntryField.first().slug}-{slug}
</code></pre>

<p>That'll pull the slug from the first related entry, add the slug from your current entry, and populate your URL. </p>

<p>As an aside, relational fields are always "arrays" even if there's only one so you need <code>.first()</code>.</p>

CC BY-SA 3.0
2015-11-04T20:31:29.583Z
2015-11-04T20:31:29.583Z
RitterKnight
<p>I've got a channel named "locations" that has an entry fieldtype which allows me to select the corresponding store/brand (limited to 1).</p>

<p>How can I define the slug of the related entry in Entry URL Format of a locations channel?</p>

<p>The final result should look like this: <code>{related-entry-slug}-{slug}</code> of the location entry itself.</p>

<p>Thank you.</p>

<url><slug>
Include related entry slug in URl
# Include related entry slug in URl

(Asked by: username_0 on 2015-11-04)

I've got a channel named "locations" that has an entry fieldtype which allows me to select the corresponding store/brand (limited to 1).

How can I define the slug of the related entry in Entry URL Format of a locations channel?

The final result should look like this: `{related-entry-slug}-{slug}` of the location entry itself.

Thank you.

**Tags:** url, slug


---

## 1 answers

### Answer by username_1 on 2015-11-04. Score: 2 | Accepted answer

Assuming your store/brand field handle in your new channel is relatedEntryField, set your URL format when you're defining the channel section to:
{relatedEntryField.first().slug}-{slug}

That'll pull the slug from the first related entry, add the slug from your current entry, and populate your URL. 
As an aside, relational fields are always "arrays" even if there's only one so you need .first().


---

