Class DynamicContentFragment
Represents a dynamic content in content string
Inheritance
Inherited Members
Namespace: EPiServer.Core.Html.StringParsing
Assembly: EPiServer.dll
Version: 10.10.4Syntax
public class DynamicContentFragment : IStringFragment, IReferenceMap, ISecurable, IContentGroup, IPersonalizedRoles
Constructors
DynamicContentFragment(IDynamicContentFactory, ISecuredFragmentMarkupGenerator, IDynamicContentBase)
Initializes a new instance of the DynamicContentFragment class.
Declaration
public DynamicContentFragment(IDynamicContentFactory factory, ISecuredFragmentMarkupGenerator securedFragmentMarkupGenerator, IDynamicContentBase dynamicContent)
Parameters
Type | Name | Description |
---|---|---|
IDynamicContentFactory | factory | The dynamic content factory. |
ISecuredFragmentMarkupGenerator | securedFragmentMarkupGenerator | The secured fragment markup generator. |
IDynamicContentBase | dynamicContent | The dynamic content. |
DynamicContentFragment(IDynamicContentFactory, ISecuredFragmentMarkupGenerator, String, String, String, Boolean)
Initializes a new instance of the DynamicContentFragment class.
Declaration
public DynamicContentFragment(IDynamicContentFactory factory, ISecuredFragmentMarkupGenerator securedFragmentMarkupGenerator, string dynamicClass, string state, string hash, bool evaluateHash)
Parameters
Type | Name | Description |
---|---|---|
IDynamicContentFactory | factory | The factory. |
ISecuredFragmentMarkupGenerator | securedFragmentMarkupGenerator | The group resolver. |
System.String | dynamicClass | The dynamic class. |
System.String | state | The state. |
System.String | hash | The hash. |
System.Boolean | evaluateHash | if set to |
Fields
DynamicClassAttributeName
Declaration
public static readonly string DynamicClassAttributeName
Field Value
Type | Description |
---|---|
System.String |
HashAttributeName
Declaration
public static readonly string HashAttributeName
Field Value
Type | Description |
---|---|
System.String |
StateAttributeName
Declaration
public static readonly string StateAttributeName
Field Value
Type | Description |
---|---|
System.String |
Properties
ContentGroup
Gets or sets the content group.
Declaration
public string ContentGroup { get; set; }
Property Value
Type | Description |
---|---|
System.String | The content group. |
DynamicContent
Gets the dynamic content for the fragment.
Declaration
public IDynamicContentBase DynamicContent { get; }
Property Value
Type | Description |
---|---|
IDynamicContentBase | The dynamic content for the fragment. |
DynamicContentFactory
Gets the dynamic content factory used to create html for the dynamic content fragment.
Declaration
public IDynamicContentFactory DynamicContentFactory { get; }
Property Value
Type | Description |
---|---|
IDynamicContentFactory | The dynamic content factory. |
InternalFormat
Gets the internal format of the dynamic content, that is what is stored in db
Declaration
public string InternalFormat { get; }
Property Value
Type | Description |
---|---|
System.String | The internal format. |
ReferencedPermanentLinkIds
Gets an System.Collections.Generic.IList<T> of permanent link ids that are referenced from this fragment.
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 fragment. |
Remarks
The implemenataion will check if the implementing IDynamicContent class implements IReferenceMap and if so call into its implemenation
SecuredFragmentMarkupGenerator
Gets or sets the secured fragment markup generator.
Declaration
protected virtual ISecuredFragmentMarkupGenerator SecuredFragmentMarkupGenerator { get; set; }
Property Value
Type | Description |
---|---|
ISecuredFragmentMarkupGenerator | The secured fragment markup generator. |
Methods
GetBasicEditFormat()
Gets the html that represents the dynamic content that can be used for simple editing.
Declaration
public string GetBasicEditFormat()
Returns
Type | Description |
---|---|
System.String | Creates a html string that represents the dynamic content that can be used for simple editing. |
See Also
GetControl(TemplateControl)
Gets the control that can be placed in Page Control collection
Declaration
[Obsolete("Use IStringFragmentControlResolver to resolve control for fragment")]
public Control GetControl(TemplateControl hostPage)
Parameters
Type | Name | Description |
---|---|---|
System.Web.UI.TemplateControl | hostPage |
Returns
Type | Description |
---|---|
System.Web.UI.Control |
GetEditFormat()
Gets the html that is used for creating a UI for the dynamic content.
Declaration
public string GetEditFormat()
Returns
Type | Description |
---|---|
System.String | A html string with both the dynamic content settings as well as an UI for the editor. |
See Also
GetRoles()
Gets all used personalized content roles from the dynamic content
Declaration
public IEnumerable<string> GetRoles()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> |
GetSecurityDescriptor()
Gets the security descriptor.
Declaration
public ISecurityDescriptor GetSecurityDescriptor()
Returns
Type | Description |
---|---|
ISecurityDescriptor | An implementation of ISecurityDescriptor. |
GetViewFormat()
Gets the format for view mode. In this case we have no page context, so in case DynamicContent renders with control we return markup else we call Render.
Declaration
public string GetViewFormat()
Returns
Type | Description |
---|---|
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(ViewContext, TextWriter)
Searches for a partial view under display templates and render the partial view if it's found
Declaration
public virtual void Render(ViewContext context, TextWriter writer)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Mvc.ViewContext | context | View context |
System.IO.TextWriter | writer | The writer to write the rendered view on |