# 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 `Id` property 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 `NodeType` property defines whether the `Content` instance should be interpreted as an image, a file, or a folder. To facilitate this, you can refer to the predefined constant values within `Constants.ImagePicker` that align with these property distinctions.
* ParentId
  * *Description:* The `ParentId` property plays a crucial role in establishing the folder hierarchy within the media picker. For example, an image should possess the `ParentId` value 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.<br>

    <figure><img src="https://3923258684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhumgDG3LdnIYeGE8nt71%2Fuploads%2Fz9lt8lzfNJmXlOATZ4Oz%2Fimage.png?alt=media&#x26;token=8845d66b-caaa-4580-85e9-5c98d54c1e75" alt=""><figcaption><p>Example of folders with and without <code>ChildrenCount</code> set</p></figcaption></figure>

{% hint style="info" %}
The ChildrenCount property is important when working with folders. The *Open Folder* button will not appear in the media picker when the folder does not have children.
{% endhint %}

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

{% content-ref url="../extensions/change-service-behavior/images" %}
[images](https://dev.ucommerce.net/readme/extensions/change-service-behavior/images)
{% endcontent-ref %}
