Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello,
I have already installed Umbraco 8.1 locally and I am doing a porting from an Umbraco 7.5 site.
This site has a code like this:
Uri uri = new Uri(umbraco.library.NiceUrlWithDomain(pageId).ToString());
and also this:
return umbraco.library.NiceUrl(id);
that, obiouvsly, does not work on Umbraco 8.1.
How can I replace them in Umbraco 8.1 to obtain the same behavior?
Thanks
Hi Paco
Have you tried:
var urlWithDomain = Umbraco.Content(id)?.Url(mode: UrlMode.Absolute);
setting the mode to be Absolute will return the domain along with the Url.
and for the nice url...
var relativeNiceUrl = Umbraco.Content(id)?.Url();
regards
Marc
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
umbraco library niceurlwithdomain and niceurl in Umbraco 8.1
Hello,
I have already installed Umbraco 8.1 locally and I am doing a porting from an Umbraco 7.5 site.
This site has a code like this:
and also this:
that, obiouvsly, does not work on Umbraco 8.1.
How can I replace them in Umbraco 8.1 to obtain the same behavior?
Thanks
Hi Paco
Have you tried:
setting the mode to be Absolute will return the domain along with the Url.
and for the nice url...
regards
Marc
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.