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: 10.10.4Syntax
public class ContentFragment : 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 |
ContentFragment(IContentLoader, TemplateControlLoader, ISecuredFragmentMarkupGenerator, DisplayOptions, IPublishedStateAssessor, IDictionary<String, Object>)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Initializes a new instance of the Content
Declaration
[Obsolete("Use alternative constructor")]
public ContentFragment(IContentLoader contentLoader, TemplateControlLoader templateControlLoader, ISecuredFragmentMarkupGenerator securedFragmentMarkupGenerator, DisplayOptions displayOptions, IPublishedStateAssessor publishedStateAssessor, IDictionary<string, object> attributes)
Parameters
Type | Name | Description |
---|---|---|
IContent |
contentLoader | |
Template |
templateControlLoader | |
ISecured |
securedFragmentMarkupGenerator | |
Display |
displayOptions | |
IPublished |
publishedStateAssessor | |
System. |
attributes |
ContentFragment(IContentLoader, ITemplateControlLoader, ISecuredFragmentMarkupGenerator, DisplayOptions, IPublishedStateAssessor, IContextModeResolver, IContentAccessEvaluator, IDictionary<String, Object>)
Initializes a new instance of the Content
Declaration
[Obsolete("Use alternative constructor")]
public ContentFragment(IContentLoader contentLoader, ITemplateControlLoader templateControlLoader, ISecuredFragmentMarkupGenerator securedFragmentMarkupGenerator, DisplayOptions displayOptions, IPublishedStateAssessor publishedStateAssessor, IContextModeResolver contextModeResolver, IContentAccessEvaluator contentAccessEvaluator, IDictionary<string, object> attributes)
Parameters
Type | Name | Description |
---|---|---|
IContent |
contentLoader | The content loader. |
ITemplate |
templateControlLoader | The template control loader. |
ISecured |
securedFragmentMarkupGenerator | The secured fragment markup generator. |
Display |
displayOptions | The display options service. |
IPublished |
publishedStateAssessor | The _published state verifier. |
IContext |
contextModeResolver | The registered context mode resolver |
IContent |
contentAccessEvaluator | The content access evaluator |
System. |
attributes | The 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
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 |
---|---|
IContent |
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 |
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<T> 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<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. |
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 |
GetControl(TemplateControl)
Declaration
[Obsolete("Use IStringFragmentControlResolver to resolve control for fragment")]
public Control GetControl(TemplateControl hostPage)
Parameters
Type | Name | Description |
---|---|---|
System. |
hostPage |
Returns
Type | Description |
---|---|
System. |
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. |