Developer Manual
Extension Methods

Extension Methods

The extension methods are part of the Hdis.Connectors.Dam.Lytho.SitecoreXp.Extensions namespace.

All these extension methods apply to the Sitecore.Data.Items.Item and Sitecore.Data.Fields.Field classes.

Methods Overview

GetAssetSelection

Returns: AssetSelection object

IsAssetField

Returns: boolean

GetSingleAsset

Returns: Asset object

GetMultiAssets

Returns: IEnumerable<Asset> object

Important Classes

The following classes from the Hdis.Api.Dam.Lytho.Models.Assets namespace are relevant when working with the extension methods.

AssetSelection

Represents a selection of one asset with one selected asset file (optional)
or a selection of multiple assets.

Property NameData TypeDefault ValueDescription
AssetsList<Asset>Empty listOne or more selected assets

Asset

Represents one asset from Lytho.

Property NameData TypeDefault ValueDescription
IdstringnullID of the asset in Lytho.
NamestringnullName of the asset in Lytho.
DescriptionstringnullDescription of the asset in Lytho.
UrlstringnullURL of the asset.

Use the GetResizedUrl() method on the Asset object to the asset URL while adding image resizing parameters.

Last updated on December 13, 2022