I'm new to Umbraco 8 so trying to get my head around a few things, one of which is how to get the URL by its IContent.
I'm in a service that doesn't inherit any Umbraco content so I'm using dependency injection to get the ContentService / EntityService etc.
Currently, when I look at the node I have as IContent it doesn't have any URL associated with it, I'm assuming because Umbraco is fairly multilingual now. How do I get the URL for a given page?
FYI, I don't have access to Umbraco.Content or I would do it that way!
Get URL from IContent
Hi All,
I'm new to Umbraco 8 so trying to get my head around a few things, one of which is how to get the URL by its IContent.
I'm in a service that doesn't inherit any Umbraco content so I'm using dependency injection to get the ContentService / EntityService etc.
Currently, when I look at the node I have as IContent it doesn't have any URL associated with it, I'm assuming because Umbraco is fairly multilingual now. How do I get the URL for a given page?
FYI, I don't have access to Umbraco.Content or I would do it that way!
Any help!?
Running Umbraco 8.1.2
hi,
Url is part of a published content. I do today like this:
//only published content have Url Current.UmbracoContext.UrlProvider.GetUrl (content.Id)
I have read here that it is not recommended to use Current this way, but I found no other way. Maybe injecting IUrlProvider
is working on a reply...