Skip to content

Configuration

phil/block-editor-bundle
# config/packages/phil_block_editor.yaml
phil_block_editor:
    preset: full              # full, or reduced for simple sites
    tools: ~                  # the block types offered, replacing those of the preset
    inline_tools: ~           # the inline tools offered, replacing those of the preset
    colors: [accent, muted, success, warning, danger]
    image_uploader: ~         # an ImageUploader service; none takes image addresses only
    mention_search: ~         # a ReferenceSearch service behind "@"
    link_search: ~            # a ReferenceSearch service behind "[["
    max_upload_bytes: 10485760
    access: IS_AUTHENTICATED  # the attribute callers of the endpoints must be granted; ~ for none
OptionDefaultEffect
presetfullThe toolset every field starts from
toolsthe preset'sThe block types offered, in any order; paragraph is required
inline_toolsthe preset'sThe inline tools offered, in any order
colorsfive tokensThe colour tokens of the text colour tool, written data-color="token"; the site's stylesheet gives each its colour
image_uploadernoneThe service id of an ImageUploader
mention_searchnoneThe service id of a ReferenceSearch for @
link_searchnoneThe service id of a ReferenceSearch for [[
max_upload_bytes10 MiBThe largest image the upload endpoint passes to the uploader. At least 1
accessIS_AUTHENTICATEDThe attribute the application's authorization checker must grant to call the endpoints; without SecurityBundle, every call is refused. ~ checks nothing: guard the routes with access_control

An unknown tool or preset, or a toolset without paragraph, is refused when the container is built.

Toolsets

Block toolUJO typeInline toolWritten as
paragraphparagraphbold<b>
headerheader, levels 1 to 6italic<i>
listlist: bulleted, numbered, to-do, nestedunderline<u class="cdx-underline">
quotequote, with its authorstrikethrough<s class="cdx-strikethrough">
codecode, with its languageinlineCode<code class="inline-code">
alertalert: a calloutlink<a href>
toggletoggle, holding blocksmarker<mark class="cdx-marker">
columnscolumns, 2 to 4, holding blockstextColor<span class="text-color" data-color>
tabletablesuperscript, subscript<sup>, <sub>
imageimagemention<a data-mention="kind:id">
delimiterdelimiterwikiLink<a data-ref="kind:id">
lineBreak<br>

The reduced preset has paragraph, header, list and quote, with bold, italic, link and lineBreak. A field may name its own toolset (forms.md).

Services

ServiceBuilt as
Phil\BlockEditorBundle\Application\ToolsetToolset::preset() with preset, tools and inline_tools
Phil\BlockEditorBundle\Infrastructure\Ujo\ToolsetNormalizerson phil/ujo-bundle's BlockTypeRegistry
Phil\BlockEditorBundle\Infrastructure\Http\EditorRequeston FrameworkBundle's CSRF token manager, the authorization checker, if any, and access
Phil\BlockEditorBundle\Infrastructure\Http\Endpointson the router, if any, and the endpoints whose service is configured
Phil\BlockEditorBundle\Infrastructure\Form\BlockEditorTypeon Ujo, the normalizers, the toolset, the endpoints, colors and the request stack; a form type
Phil\BlockEditorBundle\Infrastructure\Http\ImageUploadControlleron image_uploader and max_upload_bytes; public
Phil\BlockEditorBundle\Infrastructure\Http\ReferenceSearchControlleron mention_search and link_search; public

The registry comes from phil/ujo-bundle, so its allow_raw setting and any type an application adds there apply to the editor's fields as well; the editor itself never writes a raw block.