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 Name | Data Type | Default Value | Description |
|---|---|---|---|
| Assets | List<Asset> | Empty list | One or more selected assets |
Asset
Represents one asset from Lytho.
| Property Name | Data Type | Default Value | Description |
|---|---|---|---|
| Id | string | null | ID of the asset in Lytho. |
| Name | string | null | Name of the asset in Lytho. |
| Description | string | null | Description of the asset in Lytho. |
| Url | string | null | URL 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