<p>In the section settings, you can specify a dynamic <a href="https://craftcms.com/docs/3.x/entries.html#entry-uri-formats" rel="nofollow noreferrer">entry URI format</a>.</p>
<p>As the docs say, this box is in fact a mini Twig template, and is preloaded with the element being saved (accessible as <code>object</code>) and its custom fields (accessible directly by their handles). Good to know that you can also use a shortcut syntax with single braces instead of double ones here.</p>
<p>So in your case you'd want something like:</p>
<p><code>{slugPrefixFieldHandle ? slugPrefixFieldHandle ~ '/' ~ slug : slug}</code></p>

CC BY-SA 4.0
2020-10-16T09:00:05.950Z
2020-10-16T09:00:05.950Z
James Smith
<p>I have a special case where the URL needs to be defined from within the entry itself. I have a dropdown that I want to populate with the URLs as values.</p>
<p>Can the dropdown value be used to generate the URL? I can not use custom site URLs because the customer/user needs to see the URL themselves from within the entry.</p>
<p>The entry is a channel.</p>
<p>So let's say the dropdown has a label called &quot;Monkey&quot;. Then I want the URL to be /monkey/article-slug.</p>

<routing>
Dynamic URL generated by a custom field dropdown value
# Dynamic URL generated by a custom field dropdown value

(Asked by: username_0 on 2020-10-16)

I have a special case where the URL needs to be defined from within the entry itself. I have a dropdown that I want to populate with the URLs as values.

Can the dropdown value be used to generate the URL? I can not use custom site URLs because the customer/user needs to see the URL themselves from within the entry.

The entry is a channel.

So let's say the dropdown has a label called "Monkey". Then I want the URL to be /monkey/article-slug.

**Tags:** routing


---

## 1 answers

### Answer by username_1 on 2020-10-16. Score: 3 | Accepted answer

In the section settings, you can specify a dynamic [entry URI format](https://craftcms.com/docs/3.x/entries.html#entry-uri-formats).

As the docs say, this box is in fact a mini Twig template, and is preloaded with the element being saved (accessible as `object`) and its custom fields (accessible directly by their handles). Good to know that you can also use a shortcut syntax with single braces instead of double ones here.

So in your case you'd want something like:

`{slugPrefixFieldHandle ? slugPrefixFieldHandle ~ '/' ~ slug : slug}`


---

