unite-cms/wysiwyg-field-bundle
WYSIWYG field bundle for Unite CMS adds a rich-text editor field type to your content models, letting editors format text with a configurable toolbar and store clean HTML. Integrates smoothly into Laravel-based Unite CMS setups for flexible content authoring.
This bundle provides a wysiwyg field type for Unite CMS, which renders a rich text editor in the admin UI and stores HTML (typically) in the underlying content type. Because Unite CMS is a Symfony-based headless CMS, the bundle plugs into the field-type registry via a Symfony service tag — you don't "use" it directly in application code, you configure it on a content type.
Minimum steps:
composer require unite-cms/wysiwyg-field-bundle
config/bundles.php if it isn't auto-registered by Symfony Flex:
UniteCMS\WysiwygFieldBundle\UniteCMSWysiwygFieldBundle::class => ['all' => true],
__type on the content type input). If the schema rebuilds cleanly and wysiwyg appears in the field-type list, you're wired up.wysiwyg field (e.g. body), then create/edit a content item — the editor renders in the form and the HTML is queryable via GraphQL after save.Look at src/ first: the field type class (usually implementing UniteCMS\CoreBundle\Field\FieldType) and Resources/config/services.yml tell you what config keys are honored and what the GraphQL output type is.
Defining a field in the content type config (YAML / admin UI):
body:
type: wysiwyg
title: Body
settings:
# typical keys: toolbar, height, allowed tags, sanitization
Use the admin UI for exploration, but commit the exported content-type YAML to version control so schema changes are reviewable.
Reading and rendering content. Unite CMS returns the stored value (HTML string) through GraphQL. Treat it as HTML and sanitize on output — a headless CMS should not assume the client is the trusted admin UI:
// Controller / API consumer
echo $purifier->purify($content['body']);
For Symfony + Twig consumers, wire up html-sanitizer (or HTMLPurifier) in your app so rendering is consistent across headless and server-rendered paths.
Seeding / fixtures. Because the field is just a string field underneath, you can programmatically set it via the Unite CMS PHP SDK or by POSTing to the GraphQL mutation:
mutation($id: ID!, $data: bodyContentTypeInput!) {
updateBodyContent(id: $id, data: $data) { id }
}
Pass the HTML string as the value of the body key.
Reusing editor HTML in other surfaces. The bundle stores raw HTML — do not store Markdown. If you need Markdown in a different pipeline (e.g., static site generator), convert at read time, not at write time, to keep the CMS consistent.
Version the content-type schema, not the bundle's config. Field settings (toolbar, allowed elements) belong to the content type; commit them. That way environments (dev/prod, multiple editors) render the same editor.
bin/console debug:container --tag=unite_cms.field_type (tag name may vary) before assuming a bundle bug.settings straight to the underlying editor (CKEditor/TinyMCE/Quill). If a setting is ignored, log the received settings in the field type's normalizeInput/serialize and confirm the actual key names — Unite CMS conventions (camelCase vs snake_case) may differ from the editor's native options.null. HTML editors often submit "" for empty content; some Unite CMS versions treat "" as non-empty for validation/required rules. Trim/empty-check before saving if required: true behaves oddly.bin/console cache:clear and reload the admin — schema changes don't appear until the GraphQL schema is rebuilt.How can I help you explore Laravel packages today?