Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IPublishedUrlProvider

    Namespace: Umbraco.Cms.Core.Routing
    Assembly: Umbraco.Core.dll
    Syntax
    public interface IPublishedUrlProvider

    Properties

    View Source

    Mode

    Gets or sets the provider url mode.

    Declaration
    UrlMode Mode { get; set; }
    Property Value
    Type Description
    UrlMode

    Methods

    View Source

    GetMediaUrl(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
    View Source

    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.

    View Source

    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.

    View Source

    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...).

    View Source

    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.

    View Source

    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.

    View Source

    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 "#".

    View Source

    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
    • Improve this Doc
    • View Source
    In This Article
    • Properties
      • Mode
    • Methods
      • GetMediaUrl(Guid, UrlMode, String, String, Nullable<Uri>)
      • GetMediaUrl(IPublishedContent, UrlMode, String, String, Nullable<Uri>)
      • GetOtherUrls(Int32)
      • GetOtherUrls(Int32, Uri)
      • GetUrl(Guid, UrlMode, String, Nullable<Uri>)
      • GetUrl(Int32, UrlMode, String, Nullable<Uri>)
      • GetUrl(IPublishedContent, UrlMode, String, Nullable<Uri>)
      • GetUrlFromRoute(Int32, String, String)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX