Try our conversational search powered by Generative AI!

Class ContentAreaItemExtensions

Extension methods for ContentArea.

Inheritance
System.Object
ContentAreaItemExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
public static class ContentAreaItemExtensions

Methods

GetContent(ContentAreaItem)

Gets the content for a ContentAreaItem

Declaration
public static IContent GetContent(this ContentAreaItem item)
Parameters
Type Name Description
ContentAreaItem item

The content area item.

Returns
Type Description
IContent

An IContent instance.

GetContent(ContentAreaItem, IContentLoader)

Gets the content for a ContentAreaItem

Declaration
[Obsolete("Use overload without IContentLoader or use contentLoader directly using ContentAreaItem.ContentLink (or ContentAreaItem.ContentGuid)")]
public static IContent GetContent(this ContentAreaItem item, IContentLoader contentLoader)
Parameters
Type Name Description
ContentAreaItem item

The item.

IContentLoader contentLoader

The content loader to use.

Returns
Type Description
IContent

An IContent instance.

LoadDisplayOption(ContentAreaItem)

Loads the DisplayOption for the current ContentAreaItem if set in the RenderSettings dictionary.

Declaration
public static DisplayOption LoadDisplayOption(this ContentAreaItem contentAreaItem)
Parameters
Type Name Description
ContentAreaItem contentAreaItem

The content area item.

Returns
Type Description
DisplayOption

A DisplayOption instance or null if the id is not found in the render settings.

LoadDisplayOption(ContentAreaItem, DisplayOptions)

Loads the DisplayOption for the current ContentAreaItem if set in the RenderSettings dictionary.

Declaration
public static DisplayOption LoadDisplayOption(this ContentAreaItem contentAreaItem, DisplayOptions displayOptions)
Parameters
Type Name Description
ContentAreaItem contentAreaItem

The content area item.

DisplayOptions displayOptions

The DisplayOptions registry

Returns
Type Description
DisplayOption

A DisplayOption instance or null if the id is not found in the render settings.