Can I set a different Umbraco context (or set a domain path context) in my Umbraco api for url providers?
Hi guys,
My case is that I have a multi-path (and multi-language) setup pointing to an Home (root) item, e.g:
Home (paths: [/], [/en], [/en/global], [/da], [/da/dk], ...)
About Us
Page 1
Page 2
...
In my Umbraco API controller, I get the content url path from the query string param and use the umbracocontext.Content.GetByRoute to get the published content.
The request looks something like this: ".../api/content/page?url=/en/global/about-us"
My issue is that whenever I get the Url for content or content link, it's a contextual property, it always returns based on my root path. A breadcrumb example:
I'm wondering if I can manipulate somehow the Umbraco context in my request lifecycle and make it follow my url custom path and possibly fix it in a "native" way, using the default providers.
Can I set a different Umbraco context (or set a domain path context) in my Umbraco api for url providers?
Hi guys,
My case is that I have a multi-path (and multi-language) setup pointing to an Home (root) item, e.g:
In my Umbraco API controller, I get the content url path from the query string param and use the umbracocontext.Content.GetByRoute to get the published content.
The request looks something like this: ".../api/content/page?url=/en/global/about-us"
My issue is that whenever I get the Url for content or content link, it's a contextual property, it always returns based on my root path. A breadcrumb example:
I would like instead to make it follow my "url" param and generates relative links like this:
I'm wondering if I can manipulate somehow the Umbraco context in my request lifecycle and make it follow my url custom path and possibly fix it in a "native" way, using the default providers.
Alternatively, It seems I can achieve that by using a custom url provider as explained here https://our.umbraco.com/Documentation/Reference/Routing/Request-Pipeline/outbound-pipeline#custom-url-provider
Is this the way to go or is there a better solution?
Thanks in advance
is working on a reply...