Operationalize external data

While Uniform Mesh lets you configure your project to access multiple external data sources, making these connections each time you create a composition can be a burden for authors.

Enable your authoring teams to stay focused on creating compelling experiences, by defining a pattern that's then referenced by other compositions to keep those data resource connections consistent and ready for your content authors.

During this lesson you will:

Goals

  1. Configure a pattern and add data resources.
  2. Learn how to use overrides for letting editors make changes.
  3. Update a composition with the pattern.
  1. In Uniform, navigate to Experience > Components.

  2. Open the component Hero.

  3. Click Patterns.

    hero-with-no-patterns
    The screen where you can create a pattern.
  4. Click Add pattern.

  5. Enter the following value for the name:

    Hero - Contentful Article
  6. Set the following parameter values:

    SectionParameter nameValue
    Display VariantBackground Image
    Presentation SettingsText colorBlack
  7. Click Save.

  1. In the side rail, click .

  2. Click Add a data resource.

  3. For the field Data Type, select Single Article.

  4. From the list of articles, select the article THE GOLDEN RATIO of COFFEE.

    About this step

    When you added a data resource to the composition, you were selecting the article to connect a specific article to the composition. In this example, you are adding a data resource to the pattern. This allows you to see real content when you map the fields from the article to the parameters on the component, but when an editor goes to use the pattern, they're able to select any article they want.

  5. For the field Name, enter the following value:

    Single Article Content
  6. Click Save.

    pattern-data-resource-contentful
    The data resource has been connected to the pattern.
  7. Click to close the data resources drawer.

Using the same approach you used to map parameters on a component in the previous section, map the following parameters on the pattern:

SectionParameter nameExternal field
ContentTitleGolden Ratio article > fields > title
ContentDescriptionGolden Ratio article > fields > description
ContentImageGolden Ratio article > fields > thumbnail > fields > file > url
  1. Click Overrides.

    default-override-settings
    Overrides are located in the right panel.
  2. In the section Variant Override, set the following values:

    SectionFieldValue
    Variant OverrideAllow overrideschecked
  3. In the section Parameters, check all of the options except for the following:

    Parameter name
    Title
    Description
    Image

    About this step

    Since the parameters you checked aren't mapped to the data resource, you must enable them to be overriden in order for an editor or author to be able to set them.

  4. Click Publish...

    About this step

    This open the Publish drawer, with details about some pre-publishing steps Uniform performed.

  5. Click Publish.

  6. In the upper left-hand corner, click to return to the Hero component settings.

  1. Navigate to Experience > Project Map.
  2. Navigate to Home > Articles > The Golden Ratio of Coffee.
  3. Click the Hero component.
  4. Click > Delete.
  5. A warning message is displayed. Click Delete.
  1. Click the Breadcrumbs component.

  2. Click > Insert before.

  3. Click the hero pattern you just added.

    pattern-added-contentful
    The component is added, but no content has been selected yet.
  4. In the right column, in the section Pattern Data, click Select.

  5. Click THE GOLDEN RATIO of COFFEE.

    data-selected-contentful
    The Contentful entry is selected.
  6. Click Save.

    composition-saved-contentful
    Content from the Contentful entry is displayed in the component.
  7. Publish the composition.