# 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="/files/HvzVOTadAb7BuDDD6uCp" 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="/pages/fvKlyqvZoNOyu0vXE08d" %}
[Images](/readme/extensions/change-service-behavior/images.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.ucommerce.net/readme/miscellaneous/media.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
