This plugin enhances Xperience by Kentico with a form control that allows users to select assets from the DAM Bynder.
Xperience Version | Library Version |
---|---|
>= 29.2.0 | 1.0.0 |
>= 29.2.0 | 1.1.0 |
>= 29.2.0 | 1.1.1 |
>= 29.2.0 | 1.1.2 |
Add the package to your application using the .NET CLI
dotnet add package XperienceCommunity.Bynder
C# data type: IEnumerable<BynderAsset>
Form component attribute: BynderSelectorComponent
Attribute configuration properties:
- MinimumAssets - sets the minimum number of selected assets, default value is 0
- MaximumAssets - sets the maximum number of selected assets, default value is 0 (unlimited)
- AssetTypes - Allows to limit allowed asset types, see the AssetTypeConsts
Example:
public class BynderImageWidgetProperties : IWidgetProperties
{
[BynderSelectorComponent(AllowedTypes = new[] { AssetTypeConsts.Image }, MinimumAssets = 1, MaximumAssets = 3)]
public IEnumerable<BynderAsset> BynderImage { get; set; }
}
Data type: bynderassets
Form component: Bynder selector form component
Form component configuration:
- MinimumAssets - sets the minimum number of selected assets, default value is 0
- MaximumAssets - sets the maximum number of selected assets, default value is 0 (unlimited)
- AssetType - Allows to limit allowed asset types, supports single select only
public class BynderAsset
{
public string Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Url { get; set; }
public string[] Extensions { get; set; }
public string[] Tags { get; set; }
public string DatabaseId { get; set; }
public string Type { get; set; }
public BynderAssetFiles Files { get; set; }
}
public class BynderAssetFiles : Dictionary<string, BynderAssetFile>
{
public BynderAssetFile Original => this.GetValueOrDefault("Original");
public BynderAssetFile Thumbnail => this.GetValueOrDefault("Thumbnail");
public BynderAssetFile Mini => this.GetValueOrDefault("Mini");
public BynderAssetFile WebImage => this.GetValueOrDefault("WebImage");
}
public class BynderAssetFile
{
public string Url { get; set; }
public int? Width { get; set; }
public int? Height { get; set; }
public int? FileSize { get; set; }
}
This static class contains constants with all possible values for limiting allowed asset types.
public static class AssetTypeConsts
{
public const string Image = "IMAGE";
public const string Document = "DOCUMENT";
public const string Video = "VIDEO";
public const string Audio = "AUDIO";
}
See more info on Bynder Docs
See the Bynder image widget implemented in the DancingGoat site BynderImageWidget
Feel free to submit issues or pull requests to the repository.
Distributed under the MIT License. See LICENSE.md
for more information.