When people start working with Sitecore Content Hub they tend to consider it another DAM solution. They quickly realize though that it is so much more. It is not only a platform which supports the entire content lifecycle but even more importantly - Sitecore Content Hub drives data design around your domain. Learn how to introduce specific domain models into Sitecore Content Hub
Data in Sitecore Content Hub
In Sitecore Content Hub data consists of content types known as Entities, such as Assets, Products or Projects. Custom content types can be created through the Entity Definition manager. The data schema is defined from the properties and relations that are created according to the member groups. An Entity definition consists of one or more Member groups. Each member is described by its type of membership, a definition of property, the relationship between entities and the taxonomy. Changing Entity definitions influences the structure of the data. It is important to note that all changes to existing entity definitions should be performed with utmost caution!
Our domain
For demo purposes, we want to personalize Sitecore Content Hub schema to store image assets and car information for a car manufacturing company. Let's store only a few car attributes like acceleration, boot space and dimensions: width and length.
Our car products are organised in product families. By a product family, we understand a group of related goods produced by the same company under the same brand. To build a better understaing, let's use Volkswagen Golf as an example. This popular car comes in a number of versions that the manufacturer refers to as models, such as:
- Golf R
- Golf GTI
- Golf Alltrack
We will model Volkswagen Golf as a product family and the individual models as products. It's a common scenario where a specific industry will use a unique vocabulary to describe the domain. For full-scale development, it's very important to understand business domain and include in design only imporant elements.
Extending the generic product domain
Sitecore Content Hub is shipped with various schemas. We will extend the generic product schema by adding our car-related properties: acceleration, boot space, width and length. To achieve this let’s create a new group called General and add our properties as new members.
To start work with our schema click the Manage button on the top menu and select Schema
The first step is to search for the Product schema
After opening it we see six existing groups: Core, Commercial, Packaging, Assets, Content and SAP.
In order to extend the M.PIM.Product
schema with car-related properties let’s create a new group called Car and add
the following properties as new members:
- acceleration
- boot space
- car width
- car length
For each of our new properties, click the add new member
button and choose PROPERTY
from the option list.
Next, select a data type for the new property. For instance, we can store car acceleration as a decimal value.
The last step is to provide property details like name, label and help text. Then save the changes.
The updated M.PIM.Product
schema should look as follows
The last step is to publish the modified schema by clicking the Publish
button.
At this point Content Hub is ready to store product information details about cars.
Present added properties
The fastest way to update existing product entities with car properties is to create a quick edit page. Just click the pencil icon on the car chart to see it.
How to create a Quick Edit page?
Detail pages such as the car detail page are used to view/edit the general properties of the product, which can be multilingual.
To work with pages click the Manage button on the top menu and select Pages
You should see a very similar dashboard to the one presented below
Choose a place where you want to store your car details subpage and click the New Subpage button
. Fill in the dialog
form with the subpage name e.g. Car details
set page type as Detail page
and choose the entity definition - in our
case M.PIM.Product
We will use the details component on the newly created subpage. The Details component displays the Entity details in a customizable manner. The list of displayed properties and relations can be modified.
Click the plus icon on the MAIN ZONE
.
and search for the Entity details
component
Set the component name, mark it as Visible and click Add.
Edit the component details and activate the Car
group.
The actual properties, relations, and definitions shown on the car detail page are implementation-specific and configurable.
The following data types are supported:
- String values (single or multi-value)
- Numeric values
- Date/time values
- Boolean values
- File References
- Relations (one-to-one, one-to-many, many-to-many)
Attach the created detail page to the search component
Last step in our exercice is to use creaded detailed page as Quick Edit
action in search component. To do that click
Mange -> Pages and find which you would like to edit. In our case it will be Home > Brands > Porduct Family
Details
Next, click the Edit
button on search component
Navigate to the OUTPUT
tab.
Click ADD OPERATION
and select Quick edit
Search for the Car details
page created previously and save all changes.
That's it! Now you can test all your changes.
References
Hero image by Kelly Sikkema, opens in a new window