Setting up the TinyMCE image picker, and DAM images in Graph and the CMS REST API
The new TinyMCE image and video pickers put images and video from the CMS and from Optimizely DAM straight into rich text, in Optimizely CMS (SaaS) and CMS 13.7.0. The companion post shows how editors use them. This one is for developers: what to set up on CMS 13, and what DAM images look like in Optimizely Graph and the CMS REST API.
On SaaS there's nothing to set up
Every SaaS site on SaaS-v2026.10.28.1227 or later has the image picker. To give a rich text property the video picker too, choose the Expanded preset in its property settings.
On CMS 13 it comes with the Content Manager
The pickers are part of the Content Manager, so your site needs to register it, and the Content Manager needs Optimizely Graph:
services
.AddContentGraph()
.AddContentManager()
.AddDamUI();
AddDamUI() is what gives the picker its Browse DAM option. With that in place the image picker is on by default. The video picker needs a toolbar change, described under Toolbars below.
Turning the pickers off
Set UseTinyMceMediaPickers to false in appsettings.json:
{
"EPiServer": {
"CmsUI": {
"ContentManager": {
"UseTinyMceMediaPickers": false
}
}
}
}
Or in code:
services.Configure<ContentManagerOptions>(o =>
{
#pragma warning disable CS0618 // Obsolete: CMS 14 will remove this option
o.UseTinyMceMediaPickers = false;
#pragma warning restore CS0618
});
The option is obsolete, so setting it in code raises warning CS0618, which is an error if you treat warnings as errors. Setting it in configuration doesn't. CMS 14 will remove the option, because we won't support both TinyMCE's image button and the new picker. Turning off the Content Manager's content selector (UseContentManagerSelector) also turns the new pickers off.
Toolbars
The image picker takes the place of TinyMCE's image button in your existing toolbars, including toolbars you set in code, so most sites don't need to change anything.
The video picker is only added automatically to properties set to the Expanded preset in their property settings, and property settings are off by default on CMS 13. To add it, or to place the buttons yourself, add epi-image-picker and epi-video-picker to a toolbar.
services.Configure<TinyMceConfiguration>(config =>
{
config.For<StandardPage>(x => x.MainBody)
.AddPlugin("media")
.Toolbar("blocks bold italic epi-link epi-image-picker epi-video-picker code");
});
Register this after AddTinyMce(), and don't add both image and epi-image-picker to one toolbar, or you'll get two image pickers.
DAM images in Optimizely Graph
Optimizely Graph returns DAM images with their DAM URL, both in rich text and in content reference properties, so a headless front end can use them as they are. This query gets a page's rich text and its promo image, which is a content reference:
{
BlogPostPage(where: { _metadata: { key: { eq: "<page key>" }, status: { eq: "Published" } } }) {
items {
BlogPostBody { html json }
BlogPostPromoImage {
key
url { type default hierarchical internal graph base }
}
}
}
}
In the rich text html, a DAM image's src is its DAM URL:
<img src="https://<your DAM host>/<asset id>" alt="Alt text for FocalPoint4.jpg" width="300" height="219" />
In the rich text json, the image's node has the same URL in url, and the CMS reference to the asset in internal:
{
"type": "image",
"internal": "cms://content/DamImageSource/84d3245cf82311f09849ae8c2b3e0c59?loc=en",
"url": "https://<your DAM host>/<asset id>",
"alt": "Alt text for FocalPoint4.jpg",
"width": "300",
"height": "219",
"children": [{ "text": "" }]
}
The content reference gives the DAM URL in default and hierarchical, the CMS reference in internal, and a graph:// URI for the DAM asset in graph:
"BlogPostPromoImage": {
"key": "84d3245cf82311f09849ae8c2b3e0c59",
"url": {
"type": "GRAPH",
"default": "https://<your DAM host>/<asset id>",
"hierarchical": "https://<your DAM host>/<asset id>",
"internal": "cms://content/DamImageSource/84d3245cf82311f09849ae8c2b3e0c59?loc=en",
"graph": "graph://cmp/cmp_PublicImageAsset/84d3245cf82311f09849ae8c2b3e0c59",
"base": null
}
}
Adding DAM images through the CMS REST API
To put a DAM image into rich text through the CMS REST API, use a cms://content/DamImageSource/<key> reference as the img src. It's the same format as for a content reference property. For example, when creating a page:
{
"contentType": "BlogPostPage",
"container": "<parent key>",
"initialVersion": {
"locale": "en",
"displayName": "API DAM image test",
"properties": {
"BlogPostBody": {
"value": {
"html": "<p><img src=\"cms://content/DamImageSource/84d3245cf82311f09849ae8c2b3e0c59\" alt=\"Sunflower\" /></p>"
}
}
}
}
}
Add any other properties your content type requires. Reading the content back returns the HTML you sent, with the same reference. The API is at https://api.cms.optimizely.com/v1 on SaaS and /_cms/v1 on CMS 13. See the docs for the CMS (SaaS) REST API and the CMS 13 REST API.
Your own sources
On CMS 13, sources you add yourself show up in the image picker too, as they do for image properties. The next post walks through adding one.
Comments