Class RenderingEngineOptionsExtensions
Extensions to help configure RenderingEngineOptions.
Inheritance
Namespace: Sitecore.AspNet.RenderingEngine.Extensions
Assembly: Sitecore.AspNet.RenderingEngine.dll
Syntax
public static class RenderingEngineOptionsExtensions : Object
Methods
AddDefaultComponentRenderer(RenderingEngineOptions)
Maps a default IComponentRenderer.
Declaration
public static RenderingEngineOptions AddDefaultComponentRenderer(this RenderingEngineOptions options)
Parameters
Type | Name | Description |
---|---|---|
RenderingEngineOptions | options | The RenderingEngineOptions to configure. |
Returns
Type | Description |
---|---|
RenderingEngineOptions | The RenderingEngineOptions so that additional calls can be chained. |
AddDefaultComponentRenderer<T>(RenderingEngineOptions)
Maps a default IComponentRenderer.
Declaration
public static RenderingEngineOptions AddDefaultComponentRenderer<T>(this RenderingEngineOptions options)
where T : IComponentRenderer
Parameters
Type | Name | Description |
---|---|---|
RenderingEngineOptions | options | The RenderingEngineOptions to configure. |
Returns
Type | Description |
---|---|
RenderingEngineOptions | The RenderingEngineOptions so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
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.
Declaration
public static RenderingEngineOptions AddDefaultPartialView(this RenderingEngineOptions options, string partialViewPath)
Parameters
Type | Name | Description |
---|---|---|
RenderingEngineOptions | options | The RenderingEngineOptions to configure. |
System.String | partialViewPath | The path of the partial view. |
Returns
Type | Description |
---|---|
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.
Declaration
public static RenderingEngineOptions AddModelBoundView<TModel>(this RenderingEngineOptions options, Predicate<string> match, string viewName)
Parameters
Type | Name | Description |
---|---|---|
RenderingEngineOptions | options | The RenderingEngineOptions to configure. |
System.Predicate<System.String> | match | A predicate to use when attempting to match a layout component. |
System.String | viewName | The view name. |
Returns
Type | Description |
---|---|
RenderingEngineOptions | The RenderingEngineOptions so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
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.
Declaration
public static RenderingEngineOptions AddModelBoundView<TModel>(this RenderingEngineOptions options, string viewName)
Parameters
Type | Name | Description |
---|---|---|
RenderingEngineOptions | options | The RenderingEngineOptions to configure. |
System.String | viewName | 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
Type | Description |
---|---|
RenderingEngineOptions | The RenderingEngineOptions so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
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.
Declaration
public static RenderingEngineOptions AddModelBoundView<TModel>(this RenderingEngineOptions options, string layoutComponentName, string viewName)
Parameters
Type | Name | Description |
---|---|---|
RenderingEngineOptions | options | The RenderingEngineOptions to configure. |
System.String | layoutComponentName | The name of the layout component. |
System.String | viewName | The view name. |
Returns
Type | Description |
---|---|
RenderingEngineOptions | The RenderingEngineOptions so that additional calls can be chained. |
Type Parameters
Name | Description |
---|---|
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.
Declaration
public static RenderingEngineOptions AddPartialView(this RenderingEngineOptions options, Predicate<string> match, string partialViewPath)
Parameters
Type | Name | Description |
---|---|---|
RenderingEngineOptions | options | The RenderingEngineOptions to configure. |
System.Predicate<System.String> | match | The predicate to use when attempting to match a layout component. |
System.String | partialViewPath | The path of the partial view. |
Returns
Type | Description |
---|---|
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.
Declaration
public static RenderingEngineOptions AddPartialView(this RenderingEngineOptions options, string partialViewPath)
Parameters
Type | Name | Description |
---|---|---|
RenderingEngineOptions | options | The RenderingEngineOptions to configure. |
System.String | partialViewPath | The path of the partial view. The file name of the partial view will be the registered Sitecore layout component name. |
Returns
Type | Description |
---|---|
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.
Declaration
public static RenderingEngineOptions AddPartialView(this RenderingEngineOptions options, string layoutComponentName, string partialViewPath)
Parameters
Type | Name | Description |
---|---|---|
RenderingEngineOptions | options | The RenderingEngineOptions to configure. |
System.String | layoutComponentName | The name of the layout component. |
System.String | partialViewPath | The path of the partial view. |
Returns
Type | Description |
---|---|
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.
Declaration
public static RenderingEngineOptions AddPostRenderingAction(this RenderingEngineOptions options, Action<HttpContext> postAction)
Parameters
Type | Name | Description |
---|---|---|
RenderingEngineOptions | options | The RenderingEngineOptions to configure. |
System.Action<Microsoft.AspNetCore.Http.HttpContext> | postAction | The action to execute after rendering engine/>. |
Returns
Type | Description |
---|---|
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.
Declaration
public static RenderingEngineOptions AddViewComponent(this RenderingEngineOptions options, Predicate<string> match, string viewComponentName)
Parameters
Type | Name | Description |
---|---|---|
RenderingEngineOptions | options | The RenderingEngineOptions to configure. |
System.Predicate<System.String> | match | A predicate to use when attempting to match a layout component. |
System.String | viewComponentName | The view component name. |
Returns
Type | Description |
---|---|
RenderingEngineOptions | The RenderingEngineOptions so that additional calls can be chained. |
AddViewComponent(RenderingEngineOptions, String)
Maps a Sitecore layout component name to a view component rendering.
Declaration
public static RenderingEngineOptions AddViewComponent(this RenderingEngineOptions options, string viewComponentName)
Parameters
Type | Name | Description |
---|---|---|
RenderingEngineOptions | options | The RenderingEngineOptions to configure. |
System.String | viewComponentName | The view component name. This is also used as the layout component registration name. |
Returns
Type | Description |
---|---|
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.
Declaration
public static RenderingEngineOptions AddViewComponent(this RenderingEngineOptions options, string layoutComponentName, string viewComponentName)
Parameters
Type | Name | Description |
---|---|---|
RenderingEngineOptions | options | The RenderingEngineOptions to configure. |
System.String | layoutComponentName | The name of the layout component. |
System.String | viewComponentName | The view component name. |
Returns
Type | Description |
---|---|
RenderingEngineOptions | The RenderingEngineOptions so that additional calls can be chained. |
MapToRequest(RenderingEngineOptions, Action<HttpRequest, SitecoreLayoutRequest>)
Adds SitecoreLayoutRequest mapping action.
Declaration
public static RenderingEngineOptions MapToRequest(this RenderingEngineOptions options, Action<HttpRequest, SitecoreLayoutRequest> mapAction)
Parameters
Type | Name | Description |
---|---|---|
RenderingEngineOptions | options | The RenderingEngineOptions to configure. |
System.Action<Microsoft.AspNetCore.Http.HttpRequest, SitecoreLayoutRequest> | mapAction | The mapping action to configure SitecoreLayoutRequest. |
Returns
Type | Description |
---|---|
RenderingEngineOptions | The RenderingEngineOptions so that additional calls can be chained. |