1

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.

3

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}

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.