November Happy Hour will be moved to Thursday December 5th.

Class ContentFragment

String fragment that represents a content placed in an XHTML string.

Inheritance
System.Object
ContentFragment
Namespace: EPiServer.Core.Html.StringParsing
Assembly: EPiServer.dll
Version: 12.0.3
Syntax
public class ContentFragment : Object, IStringFragment, IReferenceMap, IContentGroup, ISecurable, IRenderSettings

Constructors

ContentFragment(IContentLoader, ISecuredFragmentMarkupGenerator, DisplayOptions, IPublishedStateAssessor, IContextModeResolver, IContentAccessEvaluator, IDictionary<String, Object>)

Initializes a new instance of the ContentFragment class.

Declaration
public ContentFragment(IContentLoader contentLoader, ISecuredFragmentMarkupGenerator securedFragmentMarkupGenerator, DisplayOptions displayOptions, IPublishedStateAssessor publishedStateAssessor, IContextModeResolver contextModeResolver, IContentAccessEvaluator contentAccessEvaluator, IDictionary<string, object> attributes)
Parameters
Type Name Description
IContentLoader contentLoader
ISecuredFragmentMarkupGenerator securedFragmentMarkupGenerator
DisplayOptions displayOptions
IPublishedStateAssessor publishedStateAssessor
IContextModeResolver contextModeResolver
IContentAccessEvaluator contentAccessEvaluator
System.Collections.Generic.IDictionary<System.String, System.Object> attributes

Fields

ClassId

Declaration
public static readonly Guid ClassId
Field Value
Type Description
System.Guid

ContentDisplayOptionAttributeName

Declaration
public static readonly string ContentDisplayOptionAttributeName
Field Value
Type Description
System.String

ContentGuidAttributeName

Declaration
public static readonly string ContentGuidAttributeName
Field Value
Type Description
System.String

ContentLinkAttributeName

Declaration
public static readonly string ContentLinkAttributeName
Field Value
Type Description
System.String

ContentNameAttributeName

Declaration
public static readonly string ContentNameAttributeName
Field Value
Type Description
System.String

Properties

ContentGroup

Gets the content group.

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

The content group.

ContentGuid

Gets or sets the unique identifier of the content referenced by the fragment.

Declaration
public virtual Guid ContentGuid { get; set; }
Property Value
Type Description
System.Guid

Gets or sets the content link.

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

The content link.

DisplayOption

Gets the Display options selected for this fragment

Declaration
public DisplayOption DisplayOption { get; }
Property Value
Type Description
DisplayOption

HasRenderSettings

Indicates if the RenderSettings has value

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

InternalFormat

Gets the internal format of the fragment, that is what is stored in db

Declaration
public virtual string InternalFormat { get; }
Property Value
Type Description
System.String

The internal format.

ReferencedPermanentLinkIds

Gets an System.Collections.Generic.IList<> 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<> of permanent link ids that are referenced from this property.

RenderSettings

Gets or sets the custom render settings for the fragment

Declaration
public IDictionary<string, object> RenderSettings { get; set; }
Property Value
Type Description
System.Collections.Generic.IDictionary<System.String, System.Object>

Tag

Gets or sets the tag for the Content Fragment.

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

Methods

GetContent()

Gets the current content host instance.

Declaration
public virtual IContent GetContent()
Returns
Type Description
IContent

GetContent(Boolean)

Retrieves the current content instance with the ability to determine if master language fallback should be used.

Declaration
public virtual IContent GetContent(bool enableMasterLanguageFallback)
Parameters
Type Name Description
System.Boolean enableMasterLanguageFallback

Whether to use fallback for languageselector or not

Returns
Type Description
IContent

GetEditFormat()

Gets the format for edit mode

Declaration
public string GetEditFormat()
Returns
Type Description
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

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.

Implements

Extension Methods