Interface IMediaUrlProvider
Provides media URL.
Namespace: Umbraco.Web.Routing
Assembly: Umbraco.Web.dll
Syntax
public interface IMediaUrlProvider
Methods
View SourceGetMediaUrl(UmbracoContext, IPublishedContent, String, UrlMode, String, Uri)
Gets the URL of a media item.
Declaration
UrlInfo GetMediaUrl(UmbracoContext umbracoContext, IPublishedContent content, string propertyAlias, UrlMode mode, string culture, Uri current)
Parameters
Type | Name | Description |
---|---|---|
UmbracoContext | umbracoContext | The Umbraco context. |
IPublishedContent | content | The published content. |
System.String | propertyAlias | The property alias to resolve the URL from. |
UrlMode | mode | The URL mode. |
System.String | culture | The variation language. |
System.Uri | current | The current absolute URL. |
Returns
Type | Description |
---|---|
UrlInfo | 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.
The URL provider can ignore the mode and always return an absolute URL, e.g. a cdn URL provider will most likely always return an absolute URL.
If the provider is unable to provide a URL, it returns null
.