Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IUrlProvider

    Provides URLs.

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

    Properties

    View Source

    Alias

    Gets the alias for the URL provider.

    Declaration
    string Alias { get; }
    Property Value
    Type Description
    string

    Methods

    View Source

    GetOtherUrls(int, Uri)

    Gets the other URLs of a published content.

    Declaration
    IEnumerable<UrlInfo> GetOtherUrls(int id, Uri current)
    Parameters
    Type Name Description
    int 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

    GetPreviewUrlAsync(IContent, string?, string?)

    Gets the preview URL of a content item.

    Declaration
    Task<UrlInfo?> GetPreviewUrlAsync(IContent content, string? culture, string? segment)
    Parameters
    Type Name Description
    IContent content

    The content item.

    string culture

    The culture to preview (null means invariant).

    string segment

    The segment to preview (null means no specific segment).

    Returns
    Type Description
    Task<UrlInfo>

    The preview URLs of the content item.

    View Source

    GetUrl(IPublishedContent, UrlMode, string?, Uri)

    Gets the URL of a published content.

    Declaration
    UrlInfo? GetUrl(IPublishedContent content, UrlMode mode, string? culture, Uri current)
    Parameters
    Type Name Description
    IPublishedContent content

    The published content.

    UrlMode mode

    The URL mode.

    string culture

    A culture.

    Uri current

    The current absolute URL.

    Returns
    Type Description
    UrlInfo

    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 should return null.

    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX