

A DatoCMS field addon that renders a live preview under a field by substituting the current value into an HTML template you define.
Editors keep the normal field UI and validation. You configure how the value should look when rendered β useful for URL embeds, color swatches, maps, and other βwhat will this become?β checks inside the CMS.

{{value}} placeholder| Field type | What {{value}} receives (before extract pattern) |
|---|---|
| Single-line string, Multiple-paragraph text, Slug | The text as entered |
| Integer, Float, Boolean | String form of the number/boolean |
| Date, DateTime | The stored date/time string |
| Color | CSS hex (#rrggbb) or rgba(...) when alpha < 1 |
| Location | latitude,longitude |
Not supported: External video (this plugin replaces that workflow with a URL string field), JSON, Modular Content, Structured Text, Single Block, assets, links, SEO.
Paste the HTML that should appear under the field. Put {{value}} wherever the current field value (or the extracted piece of it) should be inserted. The value is HTML-escaped before substitution.
Field value example: https://www.youtube.com/watch?v=wzQWBGkzxSI
Extract pattern
(?:youtube\.com/(?:watch\?.*v=|embed/|shorts/)|youtu\.be/)([\w-]{11})Preview HTML
<iframe width="560" height="315" src="https://www.youtube.com/embed/{{value}}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe><div></div>If the field already stores something embed-ready, leave the extract pattern empty:
<iframe width="100%" height="315" src="{{value}}" title="Embed preview" frameborder="0" allowfullscreen></iframe>Optional JavaScript regular expression.
| When | What {{value}} becomes |
|---|---|
| Pattern is set | Capture group 1, or the full match if there is no group |
| Pattern is empty | The normalized field value |
| Value does not match | An error under the field instead of a blank preview |
Optional. Leave empty to auto-size the preview to its content (including embeds that load asynchronously, like X cards). Set a pixel height only when you need a fixed frame.
When the field is empty, the addon shows a short note that the preview appears once a value is present. It does not invent a default.
datocms-plugin-field-value-preview.pnpm installpnpm --filter datocms-plugin-field-value-preview devThen add a private plugin whose entry point is http://localhost:5175/. Use Chrome or Firefox; Safari does not handle localhost plugin iframes well.
If you previously installed this plugin under the old html-field-preview name/URL, remove that private plugin (or switch its entry point) and re-add the addon on your fields β extension IDs changed with the rename.
To keep a working Marketplace install untouched, duplicate it and point only the copy at localhost.
cd plugins/field-value-previewpnpm publishThe package publishes dist/ plus the marketplace images in docs/. Bump version before each release. Existing DatoCMS installs do not update themselves; use Switch to a different version.