Set property editor for content type properties in @optimizely/cms-sdk
In Optimizely CMS (SaaS), OCP apps can provide custom property editors (UI extensions). Today, the only way to use one is to open Settings > Content Types, select the property and choose the editor by hand. @optimizely/cms-sdk has no option for this, so content types defined in code can’t say which editor a property should use.
Impact:
- Manual work after every sync: an admin has to select the editor in the CMS for each property on each content type.
- Repeated per environment: the setting has to be redone on every CMS instance, such as dev, test and production, because it isn’t in code.
- Contracts don’t help: a property shared through a contract still needs its editor set on every content type that extends it.
- Easy to miss: if a step is forgotten, editors see a plain text box instead of the intended editor.
Suggested solution:
Add an editor option to property definitions in @optimizely/cms-sdk that points to an installed UI extension, for example:
VersionInfo: {
type: 'string',
editor: 'optimizelysaasversioninspector/version-banner'
}
- Apply it on sync, like the other property settings.
- Support it on contract properties, so every content type that extends the contract gets the same editor.
- If the extension isn’t installed, fall back to the default editor and log a warning.
1
vote