Adding prefix to url in Umbraco Heartcore
a
Hello! We are building a headless site with Next.js and Umbraco Heartcore for a client. So far the url structure of the frontend has matched the document structure in Umbraco, which has allowed us to fetch documents using urls. However, now we needed to add a prefix to one document type in the frontend, but don't necessarily want to nest it in a folder or such in Umbraco CMS. We've read about the
umbracoUrlName
and
umbracoUrlAlias
here https://docs.umbraco.com/umbraco-cms/reference/routing/routing-properties which seem to solve this exact problem. However we don't want the client to have to manually enter the url for each document they create. Is it possible to pre-fill this field with a prefix? For example, i'd like to have a default like
/my-prefix/{documentName}
where
{documentName}
is automatically replaced with the slug of the document. We have considered nesting the document type within a folder, but then the problem becomes that the client can create any number of said folders, which we don't want to allow. As a reminder, we are using Heartcore so to my knowledge we don't have access to any of the C# apis to extend or modify existing Umbraco behaviour. Appreciate any help. Thank you!
13 Views