<p>I've successfully used this entry url format and it works great:</p>

<pre><code>{{ craft.entries.id(65).first.uri }}/{slug}
</code></pre>

<p>I would advise using the entry id over a slug, as it will never change. You also don't need to specify the section if you've included the id.</p>

<p>For a multi-lingual site, you can specify the locale for each entry url format:</p>

<pre><code>{{ craft.entries.id(65).locale('en_us').first.uri }}/{slug}
{{ craft.entries.id(65).locale('de').first.uri }}/{slug}
{{ craft.entries.id(65).locale('fr').first.uri }}/{slug}
</code></pre>

<p>As you mention in your comment, you do need to beware of updating the parent entry's slug as uri's are parsed before being stored in the database so it is not truly dynamic. I'm not aware of any workarounds for this that don't involve a plugin.</p>

CC BY-SA 4.0
2023-10-23T21:14:49.240Z
Thanks this helped me. The double curlies were key. Here's a more modern craft 4 syntax (I used entry type in the query to make it a hair more dynamic): 

{{ craft.entries().type('departmentListing').one().uri }}/{slug}
Brimby
CC BY-SA 3.0
2015-02-20T13:03:40.017Z
2015-02-20T13:03:40.017Z
Ben Croker
<p>I have a Structure section and a Channel section.</p>

<p>Entries in the Channel will be listed on one of the Structure Entries, and it's entry page will fit the same URL format.</p>

<p>So for example, the Structure Entry may be:</p>

<p>Title: "Our People"<br>
URL: /about/our-people"</p>

<p>...and the Channel entry may be:</p>

<p>Title: "Jamie"<br>
URL: /about/our-people/{slug}</p>

<p>When I set up the Channel is there any way of dynamically setting it's "Entry URL Format" based on another entry's URL/slug? I can set it to "/about/our-people/{slug}" but if the Structure entry's slug ever changes it'll be wrong.</p>

<p>I've tried adding the following to the Channel's Entry URL Format field and it seems to work (high fives P&amp;T).</p>

<pre><code>{% set parent = craft.entries.section('site').id('32').first() %}{{ parent.uri }}/{slug}
</code></pre>

<p>Is there anything I should be worried about using that? Obviously if that parent entry is deleted things will break. Anything else?</p>

CC BY-SA 3.0
2014-07-30T16:16:33.180Z
If the Structure parent entry is ever changed, or it's slug is changed it looks like all the entries in the Channel section would need to be resaved individually to pick up the change. Which isn't ideal.
Jamie Pittock
CC BY-SA 3.0
2014-07-31T15:58:12.917Z
`/about/our-people/{slug}` would still work after you change the structure's slug to, let's say `/about/team`. Only thing that changes is, yep, the url to the structure entry. Just don't link to your entries with relative URLs (you probably wouldn't anyways, just saying).
carlcs
<url>
Dynamically setting a channel's Entry URL Format with Craft tags
# Dynamically setting a channel's Entry URL Format with Craft tags

(Asked by: username_0 on 2014-07-30)

I have a Structure section and a Channel section.
Entries in the Channel will be listed on one of the Structure Entries, and it's entry page will fit the same URL format.
So for example, the Structure Entry may be:
Title: "Our People"
URL: /about/our-people"
...and the Channel entry may be:
Title: "Jamie"
URL: /about/our-people/{slug}
When I set up the Channel is there any way of dynamically setting it's "Entry URL Format" based on another entry's URL/slug? I can set it to "/about/our-people/{slug}" but if the Structure entry's slug ever changes it'll be wrong.
I've tried adding the following to the Channel's Entry URL Format field and it seems to work (high fives P&T).
{% set parent = craft.entries.section('site').id('32').first() %}{{ parent.uri }}/{slug}

Is there anything I should be worried about using that? Obviously if that parent entry is deleted things will break. Anything else?

**Tags:** url

> **Comments:**
> **username_0**: If the Structure parent entry is ever changed, or it's slug is changed it looks like all the entries in the Channel section would need to be resaved individually to pick up the change. Which isn't ideal.  
> **username_1**: `/about/our-people/{slug}` would still work after you change the structure's slug to, let's say `/about/team`. Only thing that changes is, yep, the url to the structure entry. Just don't link to your entries with relative URLs (you probably wouldn't anyways, just saying).  

---

## 1 answers

### Answer by username_2 on 2015-02-20. Score: 8

I've successfully used this entry url format and it works great:
{{ craft.entries.id(65).first.uri }}/{slug}

I would advise using the entry id over a slug, as it will never change. You also don't need to specify the section if you've included the id.
For a multi-lingual site, you can specify the locale for each entry url format:
{{ craft.entries.id(65).locale('en_us').first.uri }}/{slug}
{{ craft.entries.id(65).locale('de').first.uri }}/{slug}
{{ craft.entries.id(65).locale('fr').first.uri }}/{slug}

As you mention in your comment, you do need to beware of updating the parent entry's slug as uri's are parsed before being stored in the database so it is not truly dynamic. I'm not aware of any workarounds for this that don't involve a plugin.

> **Comments:**
> **username_3**: Thanks this helped me. The double curlies were key. Here's a more modern craft 4 syntax (I used entry type in the query to make it a hair more dynamic):   {{ craft.entries().type('departmentListing').one().uri }}/{slug}  

---

