Class ContentFinderByUrlAndTemplate
Provides an implementation of IContentFinder that handles page nice URLs and a template.
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 SourceContentFinderByUrlAndTemplate(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 SourceTryFindContent(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 |
Returns
Type | Description |
---|---|
Task<System.Boolean> | A value indicating whether an Umbraco document was found and assigned. |
Remarks
If successful, also assigns the template.