Search Results for

    Show / Hide Table of Contents
    View Source

    Class DefaultUrlProvider

    Provides urls.

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core.Routing
    Assembly: Umbraco.Core.dll
    Syntax
    public class DefaultUrlProvider : IUrlProvider

    Constructors

    View Source

    DefaultUrlProvider(IOptionsMonitor<RequestHandlerSettings>, ILogger<DefaultUrlProvider>, ISiteDomainMapper, IUmbracoContextAccessor, UriUtility)

    Declaration
    public DefaultUrlProvider(IOptionsMonitor<RequestHandlerSettings> requestSettings, ILogger<DefaultUrlProvider> logger, ISiteDomainMapper siteDomainMapper, IUmbracoContextAccessor umbracoContextAccessor, UriUtility uriUtility)
    Parameters
    Type Name Description
    IOptionsMonitor<RequestHandlerSettings> requestSettings
    ILogger<DefaultUrlProvider> logger
    ISiteDomainMapper siteDomainMapper
    IUmbracoContextAccessor umbracoContextAccessor
    UriUtility uriUtility
    View Source

    DefaultUrlProvider(IOptionsMonitor<RequestHandlerSettings>, ILogger<DefaultUrlProvider>, ISiteDomainMapper, IUmbracoContextAccessor, UriUtility, ILocalizationService)

    Declaration
    public DefaultUrlProvider(IOptionsMonitor<RequestHandlerSettings> requestSettings, ILogger<DefaultUrlProvider> logger, ISiteDomainMapper siteDomainMapper, IUmbracoContextAccessor umbracoContextAccessor, UriUtility uriUtility, ILocalizationService localizationService)
    Parameters
    Type Name Description
    IOptionsMonitor<RequestHandlerSettings> requestSettings
    ILogger<DefaultUrlProvider> logger
    ISiteDomainMapper siteDomainMapper
    IUmbracoContextAccessor umbracoContextAccessor
    UriUtility uriUtility
    ILocalizationService localizationService

    Methods

    View Source

    GetOtherUrls(Int32, Uri)

    Gets the other URLs of a published content.

    Declaration
    public virtual 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(IPublishedContent, UrlMode, String, Uri)

    Gets the URL of a published content.

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

    The published content.

    UrlMode mode

    The URL mode.

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

    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • DefaultUrlProvider(IOptionsMonitor<RequestHandlerSettings>, ILogger<DefaultUrlProvider>, ISiteDomainMapper, IUmbracoContextAccessor, UriUtility)
      • DefaultUrlProvider(IOptionsMonitor<RequestHandlerSettings>, ILogger<DefaultUrlProvider>, ISiteDomainMapper, IUmbracoContextAccessor, UriUtility, ILocalizationService)
    • Methods
      • GetOtherUrls(Int32, Uri)
      • GetUrl(IPublishedContent, UrlMode, String, Uri)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX