I use the api (contentservice) of Umbraco 7. How can I get the nice URL of the item I selected with the api?
I can get the nodeID and link with the nodeID to the page, but I want nice seo-friendly url's if that's possible.
var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
var contentItem = ApplicationContext.Current.Services.ContentService.GetById(1234);
var contentItemUrl = umbracoHelper.NiceUrl(contentItem.Id);
API + umbraco URL
Hi!
I use the api (contentservice) of Umbraco 7. How can I get the nice URL of the item I selected with the api? I can get the nodeID and link with the nodeID to the page, but I want nice seo-friendly url's if that's possible.
Thanks in advance for your help.
Kind regards, Rik
Hi Rik,
Something like the following should do the trick:
Hope that helps.
Thanks, Dan.
Or if you are doing this within a view/template, you could use the following:
Thanks, Dan.
Thank you Dan. Your solution works!
is working on a reply...