Interface IPublishedUrlProvider
Namespace: Umbraco.Cms.Core.Routing
Assembly: Umbraco.Core.dll
Syntax
public interface IPublishedUrlProvider
Properties
View SourceMode
Gets or sets the provider url mode.
Declaration
UrlMode Mode { get; set; }
Property Value
| Type | Description |
|---|---|
| UrlMode |
Methods
View SourceGetMediaUrl(Guid, UrlMode, String, String, Nullable<Uri>)
Gets the url of a media item.
Declaration
string GetMediaUrl(Guid id, UrlMode mode = UrlMode.Default, string culture = null, string propertyAlias = "umbracoFile", Uri? current = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | |
| UrlMode | mode | |
| System.String | culture | |
| System.String | propertyAlias | |
| System.Nullable<Uri> | current |
Returns
| Type | Description |
|---|---|
| System.String |
GetMediaUrl(IPublishedContent, UrlMode, String, String, Nullable<Uri>)
Gets the url of a media item.
Declaration
string GetMediaUrl(IPublishedContent content, UrlMode mode = UrlMode.Default, string culture = null, string propertyAlias = "umbracoFile", Uri? current = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IPublishedContent | content | The published content. |
| UrlMode | mode | The url mode. |
| System.String | culture | The variation language. |
| System.String | propertyAlias | The property alias to resolve the url from. |
| System.Nullable<Uri> | current | The current absolute url. |
Returns
| Type | Description |
|---|---|
| System.String | The url for the media. |
Remarks
The url is absolute or relative depending on mode and on current.
If the media is multi-lingual, gets the url for the specified culture or, when no culture is specified, the current culture.
If the provider is unable to provide a url, it returns System.String.Empty.
GetOtherUrls(Int32)
Gets the other urls of a published content.
Declaration
IEnumerable<UrlInfo> GetOtherUrls(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | The published content id. |
Returns
| Type | Description |
|---|---|
| IEnumerable<UrlInfo> | The other urls for the published content. |
Remarks
Other urls are those that GetUrl would not return in the current context, but would be valid
urls for the node in other contexts (different domain for current request, umbracoUrlAlias...).
The results depend on the current url.
GetOtherUrls(Int32, Uri)
Gets the other urls of a published content.
Declaration
IEnumerable<UrlInfo> GetOtherUrls(int id, Uri current)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | The published content id. |
| Uri | current | The current absolute url. |
Returns
| Type | Description |
|---|---|
| IEnumerable<UrlInfo> | The other urls for the published content. |
Remarks
Other urls are those that GetUrl would not return in the current context, but would be valid
urls for the node in other contexts (different domain for current request, umbracoUrlAlias...).
GetUrl(Guid, UrlMode, String, Nullable<Uri>)
Gets the url of a published content.
Declaration
string GetUrl(Guid id, UrlMode mode = UrlMode.Default, string culture = null, Uri? current = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The published content identifier. |
| UrlMode | mode | The url mode. |
| System.String | culture | A culture. |
| System.Nullable<Uri> | current | The current absolute url. |
Returns
| Type | Description |
|---|---|
| System.String | The url for the published content. |
GetUrl(Int32, UrlMode, String, Nullable<Uri>)
Gets the url of a published content.
Declaration
string GetUrl(int id, UrlMode mode = UrlMode.Default, string culture = null, Uri? current = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | The published content identifier. |
| UrlMode | mode | The url mode. |
| System.String | culture | A culture. |
| System.Nullable<Uri> | current | The current absolute url. |
Returns
| Type | Description |
|---|---|
| System.String | The url for the published content. |
GetUrl(IPublishedContent, UrlMode, String, Nullable<Uri>)
Gets the url of a published content.
Declaration
string GetUrl(IPublishedContent content, UrlMode mode = UrlMode.Default, string culture = null, Uri? current = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IPublishedContent | content | The published content. |
| UrlMode | mode | The url mode. |
| System.String | culture | A culture. |
| System.Nullable<Uri> | current | The current absolute url. |
Returns
| Type | Description |
|---|---|
| System.String | The url for the published content. |
Remarks
The url is absolute or relative depending on mode and on current.
If the published content is multi-lingual, gets the url for the specified culture or, when no culture is specified, the current culture.
If the provider is unable to provide a url, it returns "#".
GetUrlFromRoute(Int32, String, String)
Declaration
string GetUrlFromRoute(int id, string route, string culture)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | |
| System.String | route | |
| System.String | culture |
Returns
| Type | Description |
|---|---|
| System.String |