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...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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...