Class ContentAreaRenderer
The default implementation for rendering a Content
Inheritance
Namespace: EPiServer.Web.Mvc.Html
Assembly: EPiServer.Cms.AspNetCore.HtmlHelpers.dll
Version: 12.0.3Syntax
public class ContentAreaRenderer : Object
Constructors
ContentAreaRenderer()
Initializes a new instance of the Content
Declaration
public ContentAreaRenderer()
ContentAreaRenderer(IContentRenderer, ITemplateResolver, IContentAreaItemAttributeAssembler, IContentRepository, IContentAreaLoader, IContextModeResolver, ContentAreaRenderingOptions, ModelExplorerFactory, IModelTemplateTagResolver)
Initializes a new instance of the Content
Declaration
public ContentAreaRenderer(IContentRenderer contentRenderer, ITemplateResolver templateResolver, IContentAreaItemAttributeAssembler attributeAssembler, IContentRepository contentRepository, IContentAreaLoader contentAreaLoader, IContextModeResolver contextModeResolver, ContentAreaRenderingOptions contentAreaRenderingOptions, ModelExplorerFactory modelExplorerFactory, IModelTemplateTagResolver modelTemplateTagResolver)
Parameters
Type | Name | Description |
---|---|---|
IContent |
contentRenderer | |
ITemplate |
templateResolver | |
IContent |
attributeAssembler | |
IContent |
contentRepository | |
IContent |
contentAreaLoader | |
IContext |
contextModeResolver | |
Content |
contentAreaRenderingOptions | |
Model |
modelExplorerFactory | |
IModel |
modelTemplateTagResolver |
Properties
ContentRepository
The content repository
Declaration
protected IContentRepository ContentRepository { get; }
Property Value
Type | Description |
---|---|
IContent |
Methods
AddNonEmptyCssClass(TagBuilder, String)
Add a css class to the Microsoft.
Declaration
protected virtual TagBuilder AddNonEmptyCssClass(TagBuilder tagBuilder, string cssClass)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
tagBuilder | The tag builder |
System. |
cssClass | The class to addd |
Returns
Type | Description |
---|---|
Microsoft. |
The given tag builder |
BeforeRenderContentAreaItemStartTag(TagBuilder, ContentAreaItem)
Executed before the Content
Declaration
protected virtual void BeforeRenderContentAreaItemStartTag(TagBuilder tagBuilder, ContentAreaItem contentAreaItem)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
tagBuilder | The tag builder |
Content |
contentAreaItem | The content area item |
GetContentAreaHtmlTag(IHtmlHelper, ContentArea)
Gets the html tag for the container. Looks in the view data for the RenderSettings.CustomTag setting.
Declaration
protected virtual string GetContentAreaHtmlTag(IHtmlHelper htmlHelper, ContentArea contentArea)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
htmlHelper | The html helper |
Content |
contentArea | The content area |
Returns
Type | Description |
---|---|
System. |
The container html tag |
GetContentAreaItemCssClass(IHtmlHelper, ContentAreaItem)
Gets the css class for the content area item. Looks in the view data for the RenderSettings.ChildrenCssClass setting.
Declaration
protected virtual string GetContentAreaItemCssClass(IHtmlHelper htmlHelper, ContentAreaItem contentAreaItem)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
htmlHelper | The html helper |
Content |
contentAreaItem | The content area item |
Returns
Type | Description |
---|---|
System. |
The css class for the content area item |
GetContentAreaItemHtmlTag(IHtmlHelper, ContentAreaItem)
Gets the html tag for the content area item. Looks in the view data for the RenderSettings.ChildrenCustomTag setting.
Declaration
protected virtual string GetContentAreaItemHtmlTag(IHtmlHelper htmlHelper, ContentAreaItem contentAreaItem)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
htmlHelper | The html helper |
Content |
contentAreaItem | The content area item |
Returns
Type | Description |
---|---|
System. |
The html tag for the content area item |
GetContentAreaItemTemplateTag(IHtmlHelper, ContentAreaItem)
Gets the template tag for the Content
Declaration
protected virtual string GetContentAreaItemTemplateTag(IHtmlHelper htmlHelper, ContentAreaItem contentAreaItem)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
htmlHelper | The html helper |
Content |
contentAreaItem | The content area item |
Returns
Type | Description |
---|---|
System. |
The template tag for the content area item |
GetContentAreaTemplateTag(IHtmlHelper)
Gets the template tag for the Content
Declaration
protected virtual string GetContentAreaTemplateTag(IHtmlHelper htmlHelper)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
htmlHelper | The html helper |
Returns
Type | Description |
---|---|
System. |
The template tag |
IsInEditMode()
Determines if the request context is in edit mode.
Declaration
protected virtual bool IsInEditMode()
Returns
Type | Description |
---|---|
System. |
if the context is in edit mode; otherwise
|
IsInEditMode(IHtmlHelper)
Determines if the request context is in edit mode.
Declaration
protected virtual bool IsInEditMode(IHtmlHelper htmlHelper)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
htmlHelper | The html helper |
Returns
Type | Description |
---|---|
System. |
if the context is in edit mode; otherwise
|
Render(IHtmlHelper, ContentArea)
Renders the Content
Declaration
public virtual void Render(IHtmlHelper htmlHelper, ContentArea contentArea)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
htmlHelper | The Html helper |
Content |
contentArea | The content area |
RenderContentAreaItem(IHtmlHelper, ContentAreaItem, String, String, String)
Render a Content
Declaration
protected virtual void RenderContentAreaItem(IHtmlHelper htmlHelper, ContentAreaItem contentAreaItem, string templateTag, string htmlTag, string cssClass)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
htmlHelper | The html helper |
Content |
contentAreaItem | The content area item to render |
System. |
templateTag | The template tag used to resolve the display template |
System. |
htmlTag | The html tag for the element wrapping the display template |
System. |
cssClass | The css class for the element wrapping the display template |
RenderContentAreaItems(IHtmlHelper, IEnumerable<ContentAreaItem>)
Render the Content
Declaration
protected virtual void RenderContentAreaItems(IHtmlHelper htmlHelper, IEnumerable<ContentAreaItem> contentAreaItems)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
htmlHelper | The html helper |
System. |
contentAreaItems | The content area items to render |
ResolveTemplate(IHtmlHelper, IContent, IEnumerable<String>)
Resolve the template for the Content
Declaration
protected virtual TemplateModel ResolveTemplate(IHtmlHelper htmlHelper, IContent content, IEnumerable<string> templateTags)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
htmlHelper | The html helper |
IContent | content | The content. |
System. |
templateTags | The template tags used to resolve the display template |
Returns
Type | Description |
---|---|
Template |
A template model |
ShouldRenderWrappingElement(IHtmlHelper)
Determine whether a container element should be rendered around the content fragments. Looks in the view data for the RenderSettings.HasContainerElement setting. Defaults to true if not defined.
Declaration
protected virtual bool ShouldRenderWrappingElement(IHtmlHelper htmlHelper)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
htmlHelper | The html helper |
Returns
Type | Description |
---|---|
System. |
The value set in the view data; otherwise true |