Sitecore XM and XP data types

This integration allows bringing any content from your Sitecore instance without code, just with a few clicks:

  1. Configure Sitecore data source
  2. Register a data type
  3. Connect content from your data type with any Uniform component
  1. In Uniform, open your project.

  2. Navigate to the Integrations tab.

  3. Scroll to the section Browse Integrations.

  4. Click Sitecore.

  5. Click Add to project.

    add-integration-to-project
  6. Enter the required values.

  7. Enter the required fields.

    FieldDescription
    URL of your Sitecore instanceThe URL to the root of the Sitecore instance. This must start with https:// (unless your Sitecore instance is running on http://localhost).
    Sitecore API keyYour Sitecore API key (or Uniform.Api.Token if you are using Sitecore 8.2).
    Site configuration nameYour Sitecore site name. This is the name of the site defined in a Sitecore config file. (This value isn't case-sensitive.)
    settings-page-initial
  8. Click Save.

Next steps

Explore the new parameter types that are available when you configure components using Uniform Canvas.

Data Source specifies the connection details to your Sitecore instance. Your Sitecore instance needs to be publicly accessible, as the connectivity will be happening from the Uniform's edge mesh layer.

Once you've installed the integration, the next step is to connect your Sitecore instance to your Uniform project by creating a new data source.

  1. Navigate to Experience > Data Types. A data type is an element that can be retrieved from a data source, so the first step is to identify a data source.

  2. Create a new data source by clicking the Add data type button and select the "Create new" option under the Sitecore label.

    add-data-source
    Add a data type.
    add-new-data-type
    Where to create a new data type from the available data sources.
  3. Provide details specific to the Sitecore instance you are connecting to:

    FieldDescription
    Sitecore instance URLThe URL to the root of the Sitecore instance. This must start with https://.
    Sitecore API keyYour Sitecore API key (or Uniform.Api.Token if you are using Sitecore 8.2).
    Site configuration nameThe name of Uniform site configuration.
  4. Name your data source. Choose a name that helps to inform your editorial users where the content is coming from. The name of the Sitecore site is a good option here.

Before you start connecting Sitecore data to your Uniform compositions, it's important to first create some data types. Data types define which types of Sitecore data editors can use.

Go to Experience > Data Types and click the Add data type button from below the Sitecore data source that you set-up earlier.

add-data-type
Add a data type after selecting the data source.

Next, you will want to select and configure a data type from the options below.

The Sitecore Item data type returns a single item from Sitecore, based on a selection by the editor in Uniform.

The following settings can be specified:

NameDescription
Allowed TemplateIf you select a template, the user can only select an item based on the selected template. The user can select any item if no template is selected (the default).
DataSource LocationsDefines a list of item locations the user can select item from. The user can select any item if no location is selected (the default).
Model BuilderAllows to get model builders data. Available options:
  • None - do not include models
  • All available model builders - aggregate models from all model builders available for selected item
  • Exact model builder - use a model from the specific model builder. You can find Component ID and Parameter Name in Sitecore configuration files
Allow Dynamic LanguageIf checked, it allows the user to specify dynamic language on the data resource screen. Read more about dynamic language support.
data-type-settings
Sitecore Item data type settings.
data-resource-select
Select Sitecore item.

The Sitecore Item by Path data type returns a single item from Sitecore. You can define the item path pattern on the data type screen using a combination of static and dynamic parts of the item path.

The following settings can be specified:

NameDescription
Item Path PatternDefines how to build item path. Use Dynamic Path variable to specify what needs to be dynamic in the item path. Usually, you may need a static prefix + dynamic part (e.g., /sitecore/content/CanvasSite/Home/${dynamicPath}). Dynamic path can accept a variable from a dynamic input (such as a slug) and retrieve the corresponding Sitecore item.
Model BuilderAllows to get model builders data. Available options:
  • None - do not include models
  • All available model builders - aggregate models from all model builders available for selected item
  • Exact model builder - use a model from the specific model builder. You can find Component ID and Parameter Name in Sitecore configuration files
Allow Dynamic LanguageIf checked, it allows the user to specify dynamic language on the data resource screen. Read more about dynamic language support.

warning

Dynamic path value should reflect Sitecore items structure and naming. For instance, If you are using URL slug with dashes as dynamic path, Sitecore item names should use dashes instead of spaces.

info

If you intend to utilize Canvas Data Type Purge Service, register sitecoreItemByPath archetype there. Read more how to configure the service.

data-type-settings
Sitecore Item by Path settings.
data-resource-screen
Create Sitecore Item by Path data resource.

warning

This functionality requires the latest v7.3 version of the Uniform connector. If you use .NET SDK please make sure to update your dependencies per packages.config

By default, Uniform connector uses language assigned to the Uniform site configuration to build Sitecore item response.

Still, you may need a way to resolve language dynamically when you have language dynamic input as a part of URL.

Check Allow Dynamic Language on the data type screen to enable dynamic language support.

allow-dynamic-language-settings
Allow dynamic language on the data type screen.

info

Language parameter appears only when the user goes to the project map node with dynamic inputs.

You may also specify optional Initial Language value. This value will be propagated to the Language parameter when the user creates data resource. You can use the exact Sitecore language or refer to a dynamic input value (${dynamic_input_key}).

Usually project map with language dynamic input includes it at the top level (e.g., /:lang/blog), so the key is static for the whole site.

data-resource-initial-language-from-data-type
Language parameter is predefined on the data resource screen.