Table of Contents

Class RenderingEngineOptionsExtensions

Namespace
Sitecore.AspNetCore.SDK.RenderingEngine.Extensions
Assembly
Sitecore.AspNetCore.SDK.RenderingEngine.dll

Extensions to help configure RenderingEngineOptions.

public static class RenderingEngineOptionsExtensions
Inheritance
RenderingEngineOptionsExtensions
Inherited Members

Methods

AddDefaultComponentRenderer(RenderingEngineOptions)

Maps a default IComponentRenderer.

public static RenderingEngineOptions AddDefaultComponentRenderer(this RenderingEngineOptions options)

Parameters

options RenderingEngineOptions

The RenderingEngineOptions to configure.

Returns

RenderingEngineOptions

The RenderingEngineOptions so that additional calls can be chained.

AddDefaultComponentRenderer<T>(RenderingEngineOptions)

Maps a default IComponentRenderer.

public static RenderingEngineOptions AddDefaultComponentRenderer<T>(this RenderingEngineOptions options) where T : IComponentRenderer

Parameters

options RenderingEngineOptions

The RenderingEngineOptions to configure.

Returns

RenderingEngineOptions

The RenderingEngineOptions so that additional calls can be chained.

Type Parameters

T

The IComponentRenderer to use for the default renderer.

AddDefaultPartialView(RenderingEngineOptions, string)

Maps any unmatched Sitecore layout component to a default partial view. This provides a visual appearance when the Sitecore layout service returns a component name that no implementation exists for. The view will receive a Component model. Ensure this is registered last as this mapping will override any subsequent component registrations.

public static RenderingEngineOptions AddDefaultPartialView(this RenderingEngineOptions options, string partialViewPath)

Parameters

options RenderingEngineOptions

The RenderingEngineOptions to configure.

partialViewPath string

The path of the partial view.

Returns

RenderingEngineOptions

The RenderingEngineOptions so that additional calls can be chained.

AddModelBoundView<TModel>(RenderingEngineOptions, Predicate<string>, string)

Maps a Sitecore layout component name to a partial view rendering, using the default Sitecore view component to model bind it.

public static RenderingEngineOptions AddModelBoundView<TModel>(this RenderingEngineOptions options, Predicate<string> match, string viewName)

Parameters

options RenderingEngineOptions

The RenderingEngineOptions to configure.

match Predicate<string>

A predicate to use when attempting to match a layout component.

viewName string

The view name.

Returns

RenderingEngineOptions

The RenderingEngineOptions so that additional calls can be chained.

Type Parameters

TModel

The model type to use for view binding.

AddModelBoundView<TModel>(RenderingEngineOptions, string)

Maps a Sitecore layout component name to a partial view rendering, using the default Sitecore view component to model bind it.

public static RenderingEngineOptions AddModelBoundView<TModel>(this RenderingEngineOptions options, string viewName)

Parameters

options RenderingEngineOptions

The RenderingEngineOptions to configure.

viewName string

The view name and layout component name. If the view name is a full path, the view's file name will be the layout component name.

Returns

RenderingEngineOptions

The RenderingEngineOptions so that additional calls can be chained.

Type Parameters

TModel

The model type to use for view binding.

AddModelBoundView<TModel>(RenderingEngineOptions, string, string)

Maps a Sitecore layout component name to a partial view rendering, using the default Sitecore view component to model bind it.

public static RenderingEngineOptions AddModelBoundView<TModel>(this RenderingEngineOptions options, string layoutComponentName, string viewName)

Parameters

options RenderingEngineOptions

The RenderingEngineOptions to configure.

layoutComponentName string

The name of the layout component.

viewName string

The view name.

Returns

RenderingEngineOptions

The RenderingEngineOptions so that additional calls can be chained.

Type Parameters

TModel

The model type to use for view binding.

AddPartialView(RenderingEngineOptions, Predicate<string>, string)

Maps a Sitecore layout component name to a partial view rendering. The view will receive a Component model.

public static RenderingEngineOptions AddPartialView(this RenderingEngineOptions options, Predicate<string> match, string partialViewPath)

Parameters

options RenderingEngineOptions

The RenderingEngineOptions to configure.

match Predicate<string>

The predicate to use when attempting to match a layout component.

partialViewPath string

The path of the partial view.

Returns

RenderingEngineOptions

The RenderingEngineOptions so that additional calls can be chained.

AddPartialView(RenderingEngineOptions, string)

Maps a Sitecore layout component name to a partial view rendering. The view will receive a Component model.

public static RenderingEngineOptions AddPartialView(this RenderingEngineOptions options, string partialViewPath)

Parameters

options RenderingEngineOptions

The RenderingEngineOptions to configure.

partialViewPath string

The path of the partial view. The file name of the partial view will be the registered Sitecore layout component name.

Returns

RenderingEngineOptions

The RenderingEngineOptions so that additional calls can be chained.

AddPartialView(RenderingEngineOptions, string, string)

Maps a Sitecore layout component name to a partial view rendering. The view will receive a Component model.

public static RenderingEngineOptions AddPartialView(this RenderingEngineOptions options, string layoutComponentName, string partialViewPath)

Parameters

options RenderingEngineOptions

The RenderingEngineOptions to configure.

layoutComponentName string

The name of the layout component.

partialViewPath string

The path of the partial view.

Returns

RenderingEngineOptions

The RenderingEngineOptions so that additional calls can be chained.

AddPostRenderingAction(RenderingEngineOptions, Action<HttpContext>)

Adds post rendering action to be executed after Rendering engine logic.

public static RenderingEngineOptions AddPostRenderingAction(this RenderingEngineOptions options, Action<HttpContext> postAction)

Parameters

options RenderingEngineOptions

The RenderingEngineOptions to configure.

postAction Action<HttpContext>

The action to execute after rendering engine/>.

Returns

RenderingEngineOptions

The RenderingEngineOptions so that additional calls can be chained.

AddViewComponent(RenderingEngineOptions, Predicate<string>, string)

Maps a Sitecore layout component name to a view component rendering.

public static RenderingEngineOptions AddViewComponent(this RenderingEngineOptions options, Predicate<string> match, string viewComponentName)

Parameters

options RenderingEngineOptions

The RenderingEngineOptions to configure.

match Predicate<string>

A predicate to use when attempting to match a layout component.

viewComponentName string

The view component name.

Returns

RenderingEngineOptions

The RenderingEngineOptions so that additional calls can be chained.

AddViewComponent(RenderingEngineOptions, string)

Maps a Sitecore layout component name to a view component rendering.

public static RenderingEngineOptions AddViewComponent(this RenderingEngineOptions options, string viewComponentName)

Parameters

options RenderingEngineOptions

The RenderingEngineOptions to configure.

viewComponentName string

The view component name. This is also used as the layout component registration name.

Returns

RenderingEngineOptions

The RenderingEngineOptions so that additional calls can be chained.

AddViewComponent(RenderingEngineOptions, string, string)

Maps a Sitecore layout component name to a view component rendering.

public static RenderingEngineOptions AddViewComponent(this RenderingEngineOptions options, string layoutComponentName, string viewComponentName)

Parameters

options RenderingEngineOptions

The RenderingEngineOptions to configure.

layoutComponentName string

The name of the layout component.

viewComponentName string

The view component name.

Returns

RenderingEngineOptions

The RenderingEngineOptions so that additional calls can be chained.

MapToRequest(RenderingEngineOptions, Action<HttpRequest, SitecoreLayoutRequest>)

Adds SitecoreLayoutRequest mapping action.

public static RenderingEngineOptions MapToRequest(this RenderingEngineOptions options, Action<HttpRequest, SitecoreLayoutRequest> mapAction)

Parameters

options RenderingEngineOptions

The RenderingEngineOptions to configure.

mapAction Action<HttpRequest, SitecoreLayoutRequest>

The mapping action to configure SitecoreLayoutRequest.

Returns

RenderingEngineOptions

The RenderingEngineOptions so that additional calls can be chained.