Mastering Sitecore CMP: Elevating Content with AI & Smart DAM Linking (Part 6)

Hello Sitecorians! 👋


Welcome back to the Mastering Sitecore CMP series. So far, we have learned how to create a custom content type, covered the basic under-the-hood concepts, and looked at CMP's role in Sitecore Content Hub and the important pages involved.


In this Part 6, we move into content operations. We will create a blog content item and use AI to write the title, quote and body. Then we will add an image straight from the DAM, and finally create a French variant of the same blog with Translate with AI. At the end, we will also look under the hood at what Content Hub stores on the entity.


So, let's get started! 😊


The Use Case

A content team writes a lot: blogs, social posts, emails, and the same content again for every market. The usual pain points are:

  • Starting from a blank page takes time.
  • Images are downloaded from the DAM and uploaded again somewhere else, so you end up with copies that go out of date.
  • Every new market needs a translated copy, often through a separate process.


CMP in Content Hub solves all three inside the same editor:


Need

CMP feature

Draft text quickly

Generate with AI on each field

Use approved images

Insert asset from the DAM

Content for other markets

Create variant with Translate with AI

Transparency

An indicator that the content was created with the help of AI


Prerequisites

Before you start, check these:

  • Your organization has the Content Hub AI capabilities (Sitecore Stream) in its subscription.
  • AI-assisted content generation and AI-assisted content translation are turned on by a superuser.
  • The fields you want to generate are configured for text generation (the Standard generation type).
  • A content type is ready. In this blog, I use the Blog content type with three fields: Title, Quote and Body.


Step 1: Open the Content Item

Create a new content item of type Blog (or open an existing one) and go to its details page. On the left you have the content fields, and on the right the Strategy and Details tabs we covered in the earlier parts. The item starts in the To do state, with empty fields:



Step 2: Generate the Title with AI

  1. Click inside the Title field. A small toolbar appears above it.
  2. Click the AI (sparkle) icon, the first icon on the toolbar.
  3. A prompt box opens. Describe what you want, for example: Generate a test title for my blog about Content Hub. Then click the arrow button to submit.
  4. AI returns a draft. Now you have four options:
    • Regenerate (the circular arrow): get a new draft from the same prompt.
    • Copy: copy the text to the clipboard.
    • Discard: throw the draft away.
    • Apply: put the draft into the field.
  5. Click Apply. The text goes into the Title field, and you see There are unsaved changes next to Save.

The AI (sparkle) icon on the field toolbar:


Writing the prompt:


The AI draft with Regenerate, Copy, Discard and Apply:


Tip: A good prompt names the content type and adds keywords and constraints. For example, Write a blog title about Content Hub, under 60 characters, for marketers works much better than write a title.


Step 3: Generate the Quote and Body with AI

The same flow works on every text field, including multi-line and rich-text fields.


Quote: click the sparkle icon on the Quote field and give a prompt that uses the context you already have. For example: Write a good quote for my blog titled 'Test Title for a Blog About Content Hub'. Review the draft and click Apply.





Body: on the Body field (a rich-text field), a simple prompt like Write a good body for the blog returns a full, structured draft with headings and paragraphs. You can scroll through it in the popup before you apply it.


After you apply it, the body keeps its formatting (Heading 2, paragraphs and so on), and you can edit it with the normal rich-text toolbar.

Note: Treat AI output as a first draft. Always read it, fix facts, and adjust the tone to your brand before you send it for review.


The "created with AI" indicator

Once you save content that includes AI-generated text, a small AI icon appears next to the content title in the header. Hover over it, and you see: This content was created with the help of AI.



This is great for transparency: reviewers and approvers know straight away that AI was involved, without asking the author.


Step 4: Smart DAM Linking with Insert Asset


This is where CMP and DAM really work together. Instead of downloading an image and uploading it again, you pick it straight from the DAM.

  1. Place your cursor in the Body field where you want the image.
  2. On the rich-text toolbar, click Insert asset (the image icon).
  3. The Insert asset dialog opens and lists the assets from your DAM. You can search, page through them, and change the thumbnail size with the slider.
  4. Click Select on the asset you want. The image is placed in the body.


Insert asset on the rich-text toolbar:


Picking an asset from the DAM:


The image placed in the body:


Why is this "smart"?

The image is not copied into the content item. Content Hub stores an <img> tag in the rich-text field that points to a public link of the DAM asset:


<figure class="image">
  <img src="https://<your-instance>/api/public/content/<public-link-id>?v=<version>"
       alt="sch test image.png" width="310">
</figure>


That gives you:

  • One source of truth: the asset lives only in the DAM, with its metadata, rights and approvals.
  • No duplicate files: nobody has to download and re-upload images.
  • Ready for delivery: the public link can be used directly when the content is published to a channel.

Tip: Only the assets the user is allowed to see appear in the dialog, so your DAM security rules apply here too. Make sure your approved images are tagged well, so content writers can find them quickly with search.


Step 5: Create a Localized Variant with Translate with AI


Now let's take the same blog to another market, in French.

  1. Save the content. It moves to In progress.
  2. In the header, click Create variant.
  3. The Localize dialog opens:
    • Name: for example, Test Title for a Blog About Content Hub - FR.
    • Locale: click + and select the target locale, for example fr-FR.
    • Translate with AI: turn it on. Content Hub then auto-translates as much of the content as it can for the target locale.



The error you may hit

When I clicked Create the first time, I got this:


Field must be filled in for the original entity

Make sure that the required fields are filled in for both the original and the variant entity



The reason: the original content item had no Locale. The variant needs to know which language it is translating from.


The fix:

  1. Close the dialog and open the Details tab of the original item.
  2. Click edit, set Locale to the source language (for example en-US), and click Save.
  3. Open Create variant again, fill in the name and locale, keep Translate with AI on, and click Create.


Setting the Locale on the original:


Creating the variant again:


The result

Content Hub creates a new content item:

  • The header shows a VARIANT badge (and the original now shows ORIGINAL).
  • The AI icon is shown, because the text was translated by AI.
  • The Locale on the Details tab is fr-FR.
  • The Title, Quote and Body are translated, for example Titre de test pour un blog sur Content Hub.
  • The image from the DAM is kept, because it is the same public link, so you don't have to insert it again.
  • The variant starts in the New state, with its own workflow, so the French team can review it on its own.


Under the Hood: What Is Stored on the Entity

As developers, we always want to see what really happened. Open the variant in the REST API at https://<your-instance>/api/entities/<content-id>. Here is a trimmed version of the M.Content entity:


{
  "Content.Brief": null,
  "Content.StrategyCompletenessStatus": null,
  "Content.ContentCompletenessStatus": null,
  "Content.NumberOfCreatedVersions": 1,
  "Content.ApprovedForCreation": false,
  "Content.IsInIdeationState": true,
  "Blog_Title": "Titre de test pour un blog sur Content Hub",
  "Blog_Quote": "<p>« Un hub de contenu solide transforme des idées dispersées en une expérience connectée… »</p>",
  "Blog_Body": "<h1>Comment créer un corps d’article de blog solide</h1><figure class=\"image\"><img src=\"https://<your-instance>/api/public/content/<public-link-id>?v=<version>\" alt=\"sch test image.png\" width=\"310\"></figure><h2>Commencez avec un objectif clair</h2><p>…</p>",
  "SocialMediaMessage_Body": null,
  "WhitePaper_Title": null
}


What this tells us:

  • The fields follow the <ContentType>_<Field> pattern. Blog_Title, Blog_Quote and Blog_Body are the fields of our Blog content type, just like the custom content type we created earlier in this series.
  • All content types share one definition. SocialMediaMessage_Body and WhitePaper_Title are also on the same entity, but they are null, because this item is a Blog. Only the fields of its own content type are filled.
  • Rich text is stored as HTML. The quote and the body are HTML strings, and the translated body still contains the same <img> tag pointing to the DAM public link.
  • AI output is normal content. There is no separate "AI field". The generated and translated text is saved in the same properties, so your existing integrations and exports keep working.


The content type itself is a relation:


"ContentTypeToContent": {
  "parent": {
    "properties": {
      "ContentType.Label": { "en-US": "Blog" },
      "Entity.Visualization": { "color": "green", "icon": "m-icon-feather" }
    },
    "href": "https://<your-instance>/api/entities/<content-type-id>"
  },
  "inherits_security": true
}


ContentTypeToContent links the item to the Blog content type, and Entity.Visualization is where the green colour and the feather icon in the UI come from. Other relations, like AudienceToContent, hold the values from the Strategy tab.


Fetching the Same Content with GraphQL

The REST API is great for checking what is stored, but front-end apps usually read content through GraphQL. The same Blog fields are available there, so a website, a mobile app or any headless front end can use the AI-written and AI-translated content directly, without copying anything.


query {
  allM_Content_Blog(first: 10) {
    results {
      id
      content_Name
      blog_Title
      blog_Quote
      blog_Body
    }
  }
}


Send it to one of these endpoints with your API key in the X-GQL-Token header:

  • Preview API (https://<your-instance>/api/graphql/preview/v1): returns content that is still in progress, useful while authors and reviewers work on it.
  • Delivery API (https://edge.sitecorecloud.io/api/graphql/v1): returns only published content, and is what your live front end should use.


The response gives blog_Title, blog_Quote and blog_Body exactly as stored, so the HTML body already contains the <img> tag with the DAM public link. The front end just renders it, and the image is served straight from Content Hub. The French variant is returned as its own content item, so your app can pick the item that matches the user's locale.


Tip: Field and type names depend on your content type, so open the GraphQL IDE in Content Hub and check the schema before you write the query. Never put the token in client-side code; call GraphQL from your server or build step.


Conclusion:

In just a few minutes, we went from an empty content item to:

  • A full blog with a title, quote and body drafted by AI and reviewed by a human.
  • An image linked from the DAM, not copied.
  • A clear AI indicator for reviewers.
  • A French variant, translated by AI, with the same image, its own locale and its own workflow.

Here is the final French variant, with the VARIANT badge, the AI icon, the fr-FR locale and the translated content:



Sources


Conclusion


In this part, we saw how CMP brings AI and the DAM into everyday content operations. Generate with AI gives writers a fast first draft on any field, Insert asset links approved images from the DAM instead of copying them, and Create variant with Translate with AI turns one item into content for another market in a click. Just remember to set the Locale on the original before you create a variant, and always review AI output before it goes for approval.


Under the hood, it is all still plain M.Content data: the same <ContentType>_<Field> properties, HTML for rich text, and public links for DAM images. So nothing changes for your integrations.


In the next part, we will continue with more CMP content operations. 🚀


I hope this helps you in your Content Hub journey! If you have any questions, feel free to drop a comment below. 😊


Stay tuned for more! 👋

Post a Comment (0)
Previous Post Next Post