mitydigital/statamic-tinymce-cloud
A Statamic addon that swaps the default editor for the cloud-hosted TinyMCE from Tiny. Add your API key, choose plugins and toolbar options, and give content editors a full-featured WYSIWYG without bundling TinyMCE locally.
composer require mitydigital/statamic-tinymce-cloud
php artisan vendor:publish # pick the statamic-tinymce-cloud config (+ views if you want to override)
.env:
TINYMCE_CLOUD_API_KEY=your-key-here
config/statamic/bard.php:
'editor' => 'tinymce-cloud',
or per-field in the blueprint:
-
handle: body
field:
type: bard
editor: tinymce-cloud
save_html: true
Start with one low-traffic field (a blog body) rather than rolling it out everywhere. The two files you'll live in are config/statamic-tinymce-cloud.php (TinyMCE init options: plugins, toolbar, menubar, content_css, valid_elements) and the blueprint that opts into it.
Global default, per-field exceptions. Set tinymce-cloud as the default Bard editor so new fields "just work", and keep fields that need the stock ProseMirror editor (or a minimal toolbar) explicitly configured in their blueprints. Mixing editors across a site is fine — they're per-field settings.
Always pair with save_html: true. TinyMCE is a real HTML editor; without save_html you'll get an editor that writes HTML into a field the rest of Statamic expects to be ProseMirror JSON. Set it at the same time you set editor.
Match the editor to the site. TinyMCE renders inside an iframe, so your front-end styles don't apply. Add a content_css pointing at a trimmed editor stylesheet (or content_style for a small block) so headings, links, and embeds look like the published page. This is the single biggest quality-of-life change for content authors.
Keep the toolbar opinionated. The addon inherits whatever you put in plugins/toolbar. Trim it to the button set your team actually uses — the default is large, and every unused plugin is another CDN script and another thing editors can break.
Rendering. With save_html: true, {{ bard_field }} emits raw HTML. If you have multiple authors, sanitise on output or restrict valid_elements/valid_children in the config rather than relying on author discipline. Nested Bards inside Replicator/Grid sets each need their own save_html and editor keys.
Environments. TinyMCE Cloud authorises by domain, so every host that renders the CP (local.test, staging, production, per-site multisite domains) must be approved in the Tiny account. Keep a separate API key per environment if you want clean usage reporting.
Deployment. No asset build of your own is required — TinyMCE comes from the CDN. After composer update, run php artisan config:clear (and view:clear if you've published views) and hard-reload the CP, since fieldtype JS is aggressively cached by the browser.
| Symptom | Usual cause |
|---|---|
| Editor area blank / 403 in console | Missing TINYMCE_CLOUD_API_KEY, or the domain isn't approved in tiny.cloud (localhost included) |
| Toolbar missing buttons you configured | Plugin not in plugins, or it's a premium plugin not on your plan — the CDN fails silently |
| Field renders nothing in the CP after updating | Stale CP asset cache — hard refresh, then php artisan config:clear |
| Existing content breaks on save | Field flipped between HTML and ProseMirror JSON without a migration |
php artisan config:clear before you conclude "the setting isn't working".valid_elements and any content_css rules after updates.How can I help you explore Laravel packages today?