Class DynamicPageProperty

A dynamic page property adapter. Displays a given property from a given page.

Inheritance
System.Object
DynamicPageProperty
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.DynamicContent.PlugIn
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
[DynamicContentPlugIn(UrlFromUi = "Edit/DynamicContent/DynamicPagePropertySettings.ascx", DisplayName = "PagePropertyPlugin", Description = "Displays a property from any page")]
public class DynamicPageProperty : IDynamicContentControl, IDynamicContentCustomPreview, IDynamicContentDisplayType, IReferenceMap, IPersonalizedRoles, IView, IDynamicContentView, IDynamicContentBase

Constructors

DynamicPageProperty()

Initializes a new instance of the DynamicPageProperty class.

Declaration
public DynamicPageProperty()

DynamicPageProperty(IContentRepository)

Initializes a new instance of the DynamicPageProperty class.

Declaration
public DynamicPageProperty(IContentRepository contentRepository)
Parameters
Type Name Description
IContentRepository contentRepository

The IContentRepository to use

DynamicPageProperty(IContentRepository, IMvcPropertyRenderer, LocalizationService, IPermanentLinkMapper)

Initializes a new instance of the DynamicPageProperty class.

Declaration
public DynamicPageProperty(IContentRepository contentRepository, IMvcPropertyRenderer mvcPropertyRenderer, LocalizationService localizationService, IPermanentLinkMapper permanentLinkMapper)
Parameters
Type Name Description
IContentRepository contentRepository

The IContentRepository to use

IMvcPropertyRenderer mvcPropertyRenderer

The property render to use when displaying the dynamic content in MVC

LocalizationService localizationService

The resource locator that should be used by the instance to get localized strings.

IPermanentLinkMapper permanentLinkMapper

The permanent link mapper.

DynamicPageProperty(IContentRepository, IMvcPropertyRenderer, LocalizationService, IPermanentLinkMapper, TemplateResolver)

Initializes a new instance of the DynamicPageProperty class.

Declaration
public DynamicPageProperty(IContentRepository contentRepository, IMvcPropertyRenderer mvcPropertyRenderer, LocalizationService localizationService, IPermanentLinkMapper permanentLinkMapper, TemplateResolver templateResolver)
Parameters
Type Name Description
IContentRepository contentRepository

The IContentRepository to use

IMvcPropertyRenderer mvcPropertyRenderer

The property render to use when displaying the dynamic content in MVC

LocalizationService localizationService

The resource locator that should be used by the instance to get localized strings.

IPermanentLinkMapper permanentLinkMapper

The permanent link mapper.

TemplateResolver templateResolver

The template resolver

Properties

Gets or sets the content link that the property is loaded from.

Declaration
public ContentReference ContentLink { get; set; }
Property Value
Type Description
ContentReference

A ContentReference to the selected content.

Gets or sets the page link that the property is loaded from.

Declaration
[Obsolete("Use propery ContentLink instead")]
public PageReference PageLink { get; set; }
Property Value
Type Description
PageReference

A PageReference to the selected page.

Properties

This control doesn't use the Properties collection, since it has it's own settings UI.

Declaration
public PropertyDataCollection Properties { get; set; }
Property Value
Type Description
PropertyDataCollection

A PropertyDataCollection.

PropertyName

Gets or sets the name of the property to display.

Declaration
public string PropertyName { get; set; }
Property Value
Type Description
System.String

A string with the name of the property.

ReferencedPermanentLinkIds

Gets an System.Collections.Generic.IList<T> of permanent link ids that are referenced from this property.

Declaration
public IList<Guid> ReferencedPermanentLinkIds { get; }
Property Value
Type Description
System.Collections.Generic.IList<System.Guid>

An System.Collections.Generic.IList<T> of permanent link ids that are referenced from this property.

RenderAsBlockElement

Gets a value indicating whether this should be rendered as a block element (div) not (span).

Declaration
public bool RenderAsBlockElement { get; }
Property Value
Type Description
System.Boolean

true if this should be rendered as a block element; otherwise, false.

Remarks

DynamicPageProperty renders as a block element.

State

Gets or sets the state for this adapter. The state will be saved on the following form, "ID of page"|"Name of property". 4|MainBody

Declaration
public string State { get; set; }
Property Value
Type Description
System.String

A String containg the state.

Methods

CreateDirectPreview()

Gets the customized editor text.

Declaration
public string CreateDirectPreview()
Returns
Type Description
System.String

An string containing customized html that will be shown in the html editor.

CreateFullBlownPreview()

Renders a custom preview.

Declaration
public string CreateFullBlownPreview()
Returns
Type Description
System.String

A string with html that can be used as a preview.

Remarks

This method is not implemented and will throw an System.NotImplementedException.

GetControl(TemplateControl)

Gets the control that is used to render this adapter.

Declaration
public Control GetControl(TemplateControl hostPage)
Parameters
Type Name Description
System.Web.UI.TemplateControl hostPage

The page that hosts this adapter.

Returns
Type Description
System.Web.UI.Control

A Property control if PageLink has a value, otherwise an empty Literal.

GetRoles()

Gets all used personalized content roles from the linked property

Declaration
public IEnumerable<string> GetRoles()
Returns
Type Description
System.Collections.Generic.IEnumerable<System.String>

RemapPermanentLinkReferences(IDictionary<Guid, Guid>)

Remaps permanent links according to the provided link mapping.

Declaration
public void RemapPermanentLinkReferences(IDictionary<Guid, Guid> idMap)
Parameters
Type Name Description
System.Collections.Generic.IDictionary<System.Guid, System.Guid> idMap

The link mapping.

Render(TextWriter)

Declaration
public void Render(TextWriter writer)
Parameters
Type Name Description
System.IO.TextWriter writer

Render(ViewContext, TextWriter)

Declaration
public virtual void Render(ViewContext context, TextWriter writer)
Parameters
Type Name Description
System.Web.Mvc.ViewContext context
System.IO.TextWriter writer

Implements

System.Web.Mvc.IView

Extension Methods