C# Class Sdl.Web.Common.Models.EclItem

Inheritance: MediaItem
Afficher le fichier Open project: sdl/dxa-web-application-dotnet

Méthodes publiques

Méthode Description
GetEclExternalMetadataValue ( string key ) : object

Convenience method to obtain a single value from ECL External Metadata.

GetXpmMarkup ( Sdl.Web.Common.Configuration.Localization localization ) : string

Gets the rendered XPM markup

ECL items will use ECL URI rather than TCM URI in XPM markup

ReadFromXhtmlElement ( XmlElement xhtmlElement ) : void

Read properties from XHTML element.

ToHtml ( string widthFactor, double aspect, string cssClass = null, int containerSize ) : string

Renders an HTML representation of the ECL Item.

This method is used by the IRichTextFragment.ToHtml() implementation and by the HtmlHelperExtensions.Media implementation. Both cases should be avoided, since HTML rendering should be done in View code rather than in Model code.

Method Details

GetEclExternalMetadataValue() public méthode

Convenience method to obtain a single value from ECL External Metadata.
public GetEclExternalMetadataValue ( string key ) : object
key string The metadata key. This can contain slashes for nested metadata (e.g. "Program/Asset/Title").
Résultat object

GetXpmMarkup() public méthode

Gets the rendered XPM markup
ECL items will use ECL URI rather than TCM URI in XPM markup
public GetXpmMarkup ( Sdl.Web.Common.Configuration.Localization localization ) : string
localization Sdl.Web.Common.Configuration.Localization The context Localization.
Résultat string

ReadFromXhtmlElement() public méthode

Read properties from XHTML element.
public ReadFromXhtmlElement ( XmlElement xhtmlElement ) : void
xhtmlElement System.Xml.XmlElement XHTML element
Résultat void

ToHtml() public méthode

Renders an HTML representation of the ECL Item.
This method is used by the IRichTextFragment.ToHtml() implementation and by the HtmlHelperExtensions.Media implementation. Both cases should be avoided, since HTML rendering should be done in View code rather than in Model code.
public ToHtml ( string widthFactor, double aspect, string cssClass = null, int containerSize ) : string
widthFactor string The factor to apply to the width - can be % (eg "100%") or absolute (eg "120").
aspect double The aspect ratio to apply.
cssClass string Optional CSS class name(s) to apply.
containerSize int The size (in grid column units) of the containing element.
Résultat string