Class ContentFragment
String fragment that represents a content placed in an XHTML string.
Inheritance
Inherited Members
Namespace: EPiServer.Core.Html.StringParsing
Assembly: EPiServer.dll
Version: 7.19.2Syntax
public class ContentFragment : IStringFragment, IReferenceMap, IContentGroup, ISecurable, IRenderSettingsConstructors
ContentFragment(IContentLoader, TemplateControlLoader, ISecuredFragmentMarkupGenerator, DisplayOptions, IPublishedStateAssessor, IDictionary<String, Object>)
Initializes a new instance of the ContentFragment class.
Declaration
public ContentFragment(IContentLoader contentLoader, TemplateControlLoader templateControlLoader, ISecuredFragmentMarkupGenerator securedFragmentMarkupGenerator, DisplayOptions displayOptions, IPublishedStateAssessor publishedStateAssessor, IDictionary<string, object> attributes)Parameters
| Type | Name | Description | 
|---|---|---|
| IContentLoader | contentLoader | The content loader. | 
| TemplateControlLoader | templateControlLoader | The template control loader. | 
| ISecuredFragmentMarkupGenerator | securedFragmentMarkupGenerator | The secured fragment markup generator. | 
| DisplayOptions | displayOptions | The display options service. | 
| IPublishedStateAssessor | publishedStateAssessor | The _published state verifier. | 
| System.Collections.Generic.IDictionary<System.String, System.Object> | attributes | The attributes. | 
ContentFragment(IContentRepository, TemplateControlLoader, ISecuredFragmentMarkupGenerator, DisplayOptions)
Initializes a new instance of the ContentFragment class.
Declaration
[Obsolete("Use other constructor")]
public ContentFragment(IContentRepository contentRepository, TemplateControlLoader templateControlLoader, ISecuredFragmentMarkupGenerator securedFragmentMarkupGenerator, DisplayOptions displayOptions)Parameters
| Type | Name | Description | 
|---|---|---|
| IContentRepository | contentRepository | The loader used to restrieve content instances. | 
| TemplateControlLoader | templateControlLoader | The control loader used to create rendering template controls. | 
| ISecuredFragmentMarkupGenerator | securedFragmentMarkupGenerator | The secured fragment markup generator. | 
| DisplayOptions | displayOptions | The display options service. | 
ContentFragment(IContentRepository, TemplateControlLoader, ISecuredFragmentMarkupGenerator, DisplayOptions, IDictionary<String, Object>)
Initializes a new instance of the ContentFragment class.
Declaration
[Obsolete("Use other constructor")]
public ContentFragment(IContentRepository contentRepository, TemplateControlLoader templateControlLoader, ISecuredFragmentMarkupGenerator securedFragmentMarkupGenerator, DisplayOptions displayOptions, IDictionary<string, object> attributes)Parameters
| Type | Name | Description | 
|---|---|---|
| IContentRepository | contentRepository | The loader used to restrieve content instances. | 
| TemplateControlLoader | templateControlLoader | The control loader used to create rendering template controls. | 
| ISecuredFragmentMarkupGenerator | securedFragmentMarkupGenerator | The secured fragment markup generator. | 
| DisplayOptions | displayOptions | The display options service. | 
| System.Collections.Generic.IDictionary<System.String, System.Object> | attributes | The custom attributes for the fragment. | 
Fields
ClassId
Declaration
public static readonly Guid ClassIdField Value
| Type | Description | 
|---|---|
| System.Guid | 
ContentDisplayOptionAttributeName
Declaration
public static readonly string ContentDisplayOptionAttributeNameField Value
| Type | Description | 
|---|---|
| System.String | 
ContentGuidAttributeName
Declaration
public static readonly string ContentGuidAttributeNameField Value
| Type | Description | 
|---|---|
| System.String | 
ContentLinkAttributeName
Declaration
public static readonly string ContentLinkAttributeNameField Value
| Type | Description | 
|---|---|
| System.String | 
ContentNameAttributeName
Declaration
public static readonly string ContentNameAttributeNameField Value
| Type | Description | 
|---|---|
| System.String | 
Properties
Content
Gets the content.
Declaration
[Obsolete("Use GetContent() instead.", false)]
public virtual IContent Content { get; }Property Value
| Type | Description | 
|---|---|
| IContent | The content. | 
ContentData
Gets the current content data instance.
Declaration
[Obsolete("Use GetContent() instead.", false)]
public virtual IContentData ContentData { get; }Property Value
| Type | Description | 
|---|---|
| IContentData | 
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 | 
ContentLink
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 | 
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<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. | 
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 | 
GetControl(TemplateControl)
Gets the control that can be placed in Page Control collection
Declaration
public Control GetControl(TemplateControl hostPage)Parameters
| Type | Name | Description | 
|---|---|---|
| System.Web.UI.TemplateControl | hostPage | 
Returns
| Type | Description | 
|---|---|
| System.Web.UI.Control | 
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. | 
