Class ContentFragment
String fragment that represents a content placed in an XHTML string.
Inheritance
Namespace: EPiServer.Core.Html.StringParsing
Assembly: EPiServer.dll
Version: 12.0.3Syntax
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 Content
Declaration
public ContentFragment(IContentLoader contentLoader, ISecuredFragmentMarkupGenerator securedFragmentMarkupGenerator, DisplayOptions displayOptions, IPublishedStateAssessor publishedStateAssessor, IContextModeResolver contextModeResolver, IContentAccessEvaluator contentAccessEvaluator, IDictionary<string, object> attributes)
Parameters
Type | Name | Description |
---|---|---|
IContent |
contentLoader | |
ISecured |
securedFragmentMarkupGenerator | |
Display |
displayOptions | |
IPublished |
publishedStateAssessor | |
IContext |
contextModeResolver | |
IContent |
contentAccessEvaluator | |
System. |
attributes |
Fields
ClassId
Declaration
public static readonly Guid ClassId
Field Value
Type | Description |
---|---|
System. |
ContentDisplayOptionAttributeName
Declaration
public static readonly string ContentDisplayOptionAttributeName
Field Value
Type | Description |
---|---|
System. |
ContentGuidAttributeName
Declaration
public static readonly string ContentGuidAttributeName
Field Value
Type | Description |
---|---|
System. |
ContentLinkAttributeName
Declaration
public static readonly string ContentLinkAttributeName
Field Value
Type | Description |
---|---|
System. |
ContentNameAttributeName
Declaration
public static readonly string ContentNameAttributeName
Field Value
Type | Description |
---|---|
System. |
Properties
ContentGroup
Gets the content group.
Declaration
public string ContentGroup { get; set; }
Property Value
Type | Description |
---|---|
System. |
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. |
ContentLink
Gets or sets the content link.
Declaration
public ContentReference ContentLink { get; set; }
Property Value
Type | Description |
---|---|
Content |
The content link. |
DisplayOption
Gets the Display options selected for this fragment
Declaration
public DisplayOption DisplayOption { get; }
Property Value
Type | Description |
---|---|
Display |
HasRenderSettings
Indicates if the RenderSettings has value
Declaration
public bool HasRenderSettings { get; }
Property Value
Type | Description |
---|---|
System. |
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. |
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. |
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. |
Tag
Gets or sets the tag for the Content Fragment.
Declaration
public string Tag { get; set; }
Property Value
Type | Description |
---|---|
System. |
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. |
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. |
GetSecurityDescriptor()
Gets the security descriptor.
Declaration
public ISecurityDescriptor GetSecurityDescriptor()
Returns
Type | Description |
---|---|
ISecurity |
An implementation of ISecurityDescriptor. |
GetViewFormat()
Gets the format for view mode
Declaration
public string GetViewFormat()
Returns
Type | Description |
---|---|
System. |
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. |
idMap | The link mapping. |