Search Results for

    Show / Hide Table of Contents
    View Source

    Class ContentFinderByUrlAndTemplate

    Provides an implementation of IContentFinder that handles page nice URLs and a template.

    Inheritance
    System.Object
    ContentFinderByUrl
    Namespace: Umbraco.Cms.Core.Routing
    Assembly: Umbraco.Core.dll
    Syntax
    public class ContentFinderByUrlAndTemplate : ContentFinderByUrl, IContentFinder
    Remarks

    This finder allows for an odd routing pattern similar to altTemplate, probably only use case is if there is an alternative mime type template and it should be routable by something like "/hello/world/json" where the JSON template is to be used for the "world" page

    Handles /foo/bar/template where /foo/bar is the nice URL of a document, and template a template alias.

    If successful, then the template of the document request is also assigned.

    Constructors

    View Source

    ContentFinderByUrlAndTemplate(ILogger<ContentFinderByUrlAndTemplate>, IFileService, IContentTypeService, IUmbracoContextAccessor, IOptionsMonitor<WebRoutingSettings>)

    Initializes a new instance of the ContentFinderByUrlAndTemplate class.

    Declaration
    public ContentFinderByUrlAndTemplate(ILogger<ContentFinderByUrlAndTemplate> logger, IFileService fileService, IContentTypeService contentTypeService, IUmbracoContextAccessor umbracoContextAccessor, IOptionsMonitor<WebRoutingSettings> webRoutingSettings)
    Parameters
    Type Name Description
    ILogger<ContentFinderByUrlAndTemplate> logger
    IFileService fileService
    IContentTypeService contentTypeService
    IUmbracoContextAccessor umbracoContextAccessor
    IOptionsMonitor<WebRoutingSettings> webRoutingSettings

    Methods

    View Source

    TryFindContent(IPublishedRequestBuilder)

    Tries to find and assign an Umbraco document to a PublishedRequest.

    Declaration
    public override Task<bool> TryFindContent(IPublishedRequestBuilder frequest)
    Parameters
    Type Name Description
    IPublishedRequestBuilder frequest

    The PublishedRequest.

    Returns
    Type Description
    Task<System.Boolean>

    A value indicating whether an Umbraco document was found and assigned.

    Remarks

    If successful, also assigns the template.

    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • ContentFinderByUrlAndTemplate(ILogger<ContentFinderByUrlAndTemplate>, IFileService, IContentTypeService, IUmbracoContextAccessor, IOptionsMonitor<WebRoutingSettings>)
    • Methods
      • TryFindContent(IPublishedRequestBuilder)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX