Table of Contents

Class AssetCategoryViewModel

Namespace
Dynamicweb.Ecommerce.ProductCatalog
Assembly
Dynamicweb.Ecommerce.dll

Represents a view model for an asset category, grouping related media assets (images, videos, documents) under a named label.

public class AssetCategoryViewModel : FillableViewModelBase
Inheritance
AssetCategoryViewModel
Inherited Members

Remarks

In Dynamicweb, product assets are organised into named categories (e.g. "Images", "Documents", "Videos"). Each category is represented by this view model and exposes its assets as a list of MediaViewModel instances.

In Razor templates, iterate Assets to render all media in this category:

@foreach (var asset in assetCategory.Assets)
{
    <img src="@asset.Value" alt="@asset.DisplayName" />
}

Properties

Assets

Gets or sets the list of media assets belonging to this category. Each entry is a MediaViewModel that exposes the asset path, display name, and keywords. Returns null when the property was not requested via the view model settings.

public List<MediaViewModel>? Assets { get; set; }

Property Value

List<MediaViewModel>

Name

Gets or sets the display name of the asset category (e.g. "Images", "Documents").

public string? Name { get; set; }

Property Value

string

SystemName

Gets or sets the system name of the asset category used to identify it programmatically (e.g. "Images"). Use this to filter or select a specific category by a stable identifier rather than the localised Name.

public string? SystemName { get; set; }

Property Value

string

See Also

To top