Defining your data model in Sitecore Content Hub

Posted by Eduardo Moraes - Director of Digital Strategy & User Experience

Sitecore Content Hub is an efficient platform for keeping all your digital assets in a centralized repository. It offers an immense amount of flexibility with tagging, security settings, and workflows.

When defining the data model of your assets, it is important to understand the different field types available in Content Hub. In Content Hub, data models are defined using schemas. In the management section of your Content Hub instance you will find the following icon:

Content Hub schema icon

Once you have clicked on this icon, you will be prompted with a list of all different schemas available.

Content Hub schema selection

For digital assets, such as images and other files, the schema you will want to edit is M.Asset. Clicking on this schema will provide you with all the different field groups it has by default. From here, you can click on “New group” to create your custom set of metadata fields.

Fields are identified as members of a group. Clicking on “New member” in your custom group will let you create your new field and select its data type:

Content Hub field creation

The available data types are:

  • String
  • Boolean
  • Integer
  • Long
  • Decimal
  • Datetime
  • Datetime offset
  • Option List
  • JSON

String, Boolean, Integer, Long, Decimal, and Datetime are pretty much self-explanatory by their names. The last three require a little bit of explanation.

Datetime Offset is explained in Content Hub’s documentation site as the following:

“Offset DateTime is a representation of a date and time with an offset. The offset is from UTC/Greenwich. For example, Jun 7, 2021 2:51 PM +02:00.”

Option Lists are very helpful when you need to have a pre-defined list of options available to content contributors. From the Management screen click on Option Lists:

Content Hub option lists

There you can define the options you want to have available to your content contributors and select that list in your option list field.

JSON fields provide a data type defined by JavaScript Object Notation. They are useful for developers extending the platform. This is not the case for regular content contributors as they won’t touch these fields as part of their daily content creation process.