Dynamic URL generated by a custom field dropdown value 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 &quot;Monkey&quot;. Then I want the URL to be /monkey/article-slug.
In the section settings, you can specify a dynamic entry URI format.
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}