Media
All media used in Ucommerce is based on the Content data model. The model describes either a file, an image, or a folder.
Content
The Content class is a specialized model designed for Ucommerce, encompassing essential properties to represent images, files, or folders within the system. Key properties of the Content class include:
Id
Description: The
Idproperty serves as a reference identifier utilized by Ucommerce. It should be configured to point to the corresponding data within your external image database.
NodeType
Description: The
NodeTypeproperty defines whether theContentinstance should be interpreted as an image, a file, or a folder. To facilitate this, you can refer to the predefined constant values withinConstants.ImagePickerthat align with these property distinctions.
ParentId
Description: The
ParentIdproperty plays a crucial role in establishing the folder hierarchy within the media picker. For example, an image should possess theParentIdvalue that corresponds to the folder it is contained within.
URL
Description: The URL used by the backoffice to render the given image.
ChildrenCount (Only applicable for folders)
Description: The number of children in the folder. If the content provider does not support a children count, leaving this property out will allow users to navigate to the folder.

Example of folders with and without ChildrenCountset
By implementing the Content class with attention to these properties, you can seamlessly manage and represent images, files, and folders within the Ucommerce system.
Related articles
ImagesLast updated
Was this helpful?