---
title: "Walkthrough: Configuring items for content import"
slug: "walkthrough--configuring-items-for-content-import"
abstract: "How to configure Sitecore items for import from Sitecore Content Hub."
---
# Walkthrough: Configuring items for content import

In order to import content from Sitecore Content Hub, you must create and configure a number of items in Sitecore.

This walkthrough describes how to create the following mandatory items:

- `Bucket` - specify where to store imported content.
- `Template` - define the structure of imported content items.
- `Entity mapping` and `Field mapping` - determine how imported content is imported and where it is stored.

The walkthrough also describes how to create the following optional items that control how relation content from Content Hub is processed:

- `Relation field mapping` - map relation content to Sitecore fields.
- `Tag field mapping` - map relation content to Sitecore tags.
- `Related entity mapping` - link different Content Hub asset types in Sitecore.

## Create a bucket

All the imported content is stored in Sitecore buckets. For example, all blog posts are stored in a bucket called *Blogs*.

To create a bucket:

1. Right-click the **CMP** folder, click **Insert**, and click **Bucket**.

    ![The right-click menu on the CMP folder, showing the option to insert a bucket item](<https://doc.sitecore.com/api/markdown-image/xp/en/developers/connect-for-ch/52/connect-for-content-hub/images/Insert%20Bucket.png>)

2. Name the bucket, for example, *Article*, and click **OK**.

## Create a template

The structure of the imported content is defined by the Sitecore templates. You must make sure that each template inherits the *Content Hub Entity* template. This template contains the **EntityIdentifier** field.

To create a template:

1. Navigate to a *CMP* folder, for example, *templates\\User Defined\\CMP Connect*. Create a template and name it, for example, *Blog*.
2. Add all the necessary fields. For example, for a blog post, add a **Title** Single-Line Text field and a **Body** Multi-Line Text field.

    ![The Builder tab on a CMP template item](<https://doc.sitecore.com/api/markdown-image/xp/en/developers/connect-for-ch/52/connect-for-content-hub/images/Builder%20tab.png>)

3. On the **Content** tab, in the **Data** section, in the **Base template** field, click **Content Hub Entity** and then click the right arrow to add it to the **Selected** list.

    ![The Data section on the Content tab showing how to select base templates](<https://doc.sitecore.com/api/markdown-image/xp/en/developers/connect-for-ch/52/connect-for-content-hub/images/Content%20tab.png>)

4. On the menu bar, on the **View** tab, select **Standard Fields** and **Buckets**.
5. On the menu bar, on the **Builder Options** tab, select **Standard Values**.
6. On the **Content** tab, in the **Item Buckets** section, select **Bucketable**. Save the item.

## Create an entity mapping

*Entity Mapping* items and *Field Mapping* items define how content is imported and in what bucket it is stored.

To create an entity mapping item:

1. Navigate to */sitecore/system/Modules/CMP*, right-click **Config**, click **Insert**, and click **Entity Mapping**. Enter the name for the new item, for example *Article*. By default, every entity mapping comes with a default field mapper for the display name.
2. Under the Article entity mapping, select `/__Display name`. On the **Content** tab, in the **CMP Field Name** field, enter a valid **Property** field name from the entity type, or schema, in Sitecore Content Hub. Sitecore uses this name as the display name.
3. Save the item.
4. In the content tree, navigate to the `Article` entity mapping.

    ![The Data section on the Content tab for the Article entity mapping](https://doc.sitecore.com/api/markdown-image/xp/en/developers/connect-for-ch/52/connect-for-content-hub/images/Content_tab_for_Article_entity_mapping_element.png)

5. On the **Content** tab, in the **Data** section, fill in the following fields:

    | Field | Content |
    | --- | --- |
    | **Entity Type Schema** | Enter the entity type used in Sitecore Content Hub |
    | **Bucket** | Enter the item bucket to keep Sitecore items created from M-Entities of a given content type ID |
    | **Template** | Enter a template to be used to create the Sitecore items. The template must contain the fields that are used to store the imported content |
    | **Item Name Property** | Enter a valid **Property** field value of the entity type as Sitecore item name |

6. Save the item.

## Create a field mapping

To map imported content to the Sitecore item structure, you must add *Field Mapping* items to each *Entity Mapping* item. You must create a *Field Mapping* item for each field that you want to import.

To create a *Field Mapping* item:

1. Right-click the *Entity Mapping* item that you created earlier, click **Insert**, and then click **Field Mapping**.
2. Enter a name, for example, *Title*, and click **OK**.
3. On the **Content** tab, in the **Data** section, fill in the following fields:

    | Field | Content |
    | --- | --- |
    | **CMP Field Name** | The name of the field in the Sitecore Content Hub |
    | **Sitecore Field Name** | The field name as defined in the template you are using |

    ![The Data section on the Content tab for a Field Mapping item showing the CMP FIeld Name and Sitecore Field Name fields](<https://doc.sitecore.com/api/markdown-image/xp/en/developers/connect-for-ch/52/connect-for-content-hub/images/CMP%20config%20blog%20title.png>)

You can add as many *Field Mapping* items as you require.

To verify the entity type and structure in the Sitecore Content Hub:

1. Create a new item in the Sitecore Content Hub or edit an existing one, for example, a blog post.
2. Copy the URL, for example, `https://yourdomain/en-us/content/detail/9782`, and paste it in a new browser tab.

    > [!note]
    > In the example URLs, replace *9782* with the ID of the entity item you have selected.

3. Change the URL to `https://yourdomain/api/entities/9782` and press **Enter**.

    The entity structure is now shown in JSON.

4. To find the entity’s content type, find the **ContentTypeToContent** relation and follow the link (`"href": "https://yourdomain/api/entities/9782"`).

    ![The ContentType ToContent node in the entity structure JSON](https://doc.sitecore.com/api/markdown-image/xp/en/developers/connect-for-ch/52/connect-for-content-hub/images/ContentTypeToContent.png)

    Now the content type is shown, in this example `M.ContentType.Blog`.

    ![The content type in the entity structure JSON](<https://doc.sitecore.com/api/markdown-image/xp/en/developers/connect-for-ch/52/connect-for-content-hub/images/M.ContentType.Blog%20identifier>)

## Create a relation field mapping

You can add relation field mappings which let you map the taxonomy fields from any content in Sitecore Content Hub to a Sitecore field. If the content belongs to multiple taxonomy values, the mapping separates the values using [the configured delimiter](https://doc.sitecore.com/xp/en/developers/connect-for-ch/52/connect-for-content-hub/changing-mapping-delimiters.html "Changing mapping delimiters").

To create a relation field mapping item:

1. Right-click the *Entity Mapping* item that you created earlier, click **Insert**, and then click **Relation Field Mapping**.
2. Enter a name, for example, *Audiences*, and click **OK** .
3. In the **Data** section, fill out the following fields:

    | Field | Content |
    | --- | --- |
    | **CMP Relation** | The relation name of the Sitecore Content Hub entity. |
    | **CMP Field Name** | The name of the property in the Sitecore Content Hub relation entity. |
    | **Sitecore Field Name** | The name of the content field where Sitecore stores the taxonomy values, as defined in the template you are using. |

    The **Data** section should look, for example, like this:

    ![Data section for a relation field mapping](https://doc.sitecore.com/api/markdown-image/xp/en/developers/connect-for-ch/52/connect-for-content-hub/images/CMP_relation_example.png)

## Create a tag field mapping

Tag field mapping lets you map the taxonomy fields from any content in Content Hub to the tag repositories in Sitecore. If the content belongs to multiple taxonomy values, the mapping separates the values using [the configured delimiter](https://doc.sitecore.com/xp/en/developers/connect-for-ch/52/connect-for-content-hub/changing-mapping-delimiters.html "Changing mapping delimiters").

To create a tag field mapping:

1. Right-click the *Entity Mapping* item that you created earlier, click **Insert**, and then click **Tag Field Mapping**.
2. Enter a name, for example, *Tag Taxonomy*. Click **OK**.
3. In the **Data** section, fill out the following fields:

    | Field | Content |
    | --- | --- |
    | **CMP Relation** | The relation name of the Sitecore Content Hub entity. |
    | **CMP Field Name** | The name of the property in the Sitecore Content Hub relation entity. |
    | **Enable / Disable to store Non-Leaf Node** | Choose one of the following:<br><br><ul><li>Enable Non-Leaf Node (Default)</li><li>Disable Non-Leaf Node</li></ul> |
    | **Store Tag Name Option As** | Choose one of the following:<br><br><ul><li>Full Path Name (Default)</li><li>Node Name</li></ul> |
    | **Custom Taxonomy Provider Name** | The name of a Sitecore custom taxonomy provider. If you select a custom taxonomy provider, Sitecore stores the taxonomy in the custom provider instead of in the default taxonomy provider. Leave this field blank to use the default taxonomy provider.<br><br>> [!note]<br>> See [Build a custom taxonomy provider](https://doc.sitecore.com/developers/92/sitecore-experience-manager/en/build-a-custom-taxonomy-provider-for-sitecore-cortex-content-tagging.html)[Build a custom taxonomy provider](https://doc.sitecore.com/developers/92/sitecore-experience-manager/en/build-a-custom-taxonomy-provider-for-sitecore-cortex-content-tagging.html) in the Sitecore developer documentation for information on how to create custom taxonomy providers. |

    The **Data** section should look, for example, like this:

    ![Data section for a tag field mapping](https://doc.sitecore.com/api/markdown-image/xp/en/developers/connect-for-ch/52/connect-for-content-hub/images/CMP_tag_field_mapping_example.png)

For more information on how the tag field mapping settings work, refer to the [Sitecore developer documentation](https://doc.sitecore.com/en/developers/)[Sitecore developer documentation](https://doc.sitecore.com/ja/developers/).

## Create a related entity mapping

Related entity mapping lets you map any entity relation in Content Hub to a field in Sitecore.

To create a related entity mapping item:

1. Right-click the Entity Mapping item that you created earlier, click **Insert**, then click **Related entity mapping**.
2. Name the entity mapping, for example, *PCMProductToMasterAsset*, and click **OK**.
3. In the **Data** section, fill out the following fields:

    | Field | Content |
    | --- | --- |
    | **CMP Relation** | The relation name of the Sitecore Content Hub entity. |
    | **Sitecore Field Name** | The name of the content field where Sitecore stores the taxonomy values, as defined in the template you are using. |

    The **Data** section should look, for example, like this:

    ![Data section for a related entity mapping](https://doc.sitecore.com/api/markdown-image/xp/en/developers/connect-for-ch/52/connect-for-content-hub/images/CMP_related_entity_mapping.png)