Supercharge default admin with a rich text editor wich managed blocks.
composer require pushword/admin-block-editor
That’s it! If you have a custom installation (not used the default installer), you may have a look inside vendor/pushword/admin/install.php.
Block editor is now ready.
If you want to go forward than a default install, you can override default parameters in your config:
admin_block_editor:
new_page: true # Set false to disable block editor for new page (because new page does not have an associated `app` yet)
Or you individually app by app:
# set false to disable block editor (and get the default Mardown Editor) for this app
admin_block_editor: true
You want to add a custom block? This is the path to follow:
I recommend you to import @PushwordAdminBlockEditor/editorjs_widget.html.twig and to create only the block editorjs_block_to_add_new_plugin
The link tool’s config (link in editorjsConfig.tools) takes three keys:
availableDesigns — label => class, the Style list (defaults: button, button outline, discreet);availableRels — label => rel value, the Rel list (defaults: obfuscate, nofollow, nofollow sponsored, nofollow ugc);options — false shows the address field alone, without the New tab switch, Rel or Style (default: true). An existing link keeps the target, rel and class it already carries when only its address is edited.Content is stored as markdown in the database. The editor converts EditorJS blocks to markdown on save, and converts markdown back to EditorJS blocks when loading the editor.
A collapsible left rail lists the blocks in use — in the block editor and in its Markdown/JSON source views alike. Headings nest their sections, group markers nest their content, and each row offers:
Alt+Arrow moves a block one row, Alt+Shift+Arrow swaps a section with the neighbouring one, bodies included,The rail overlays the admin navigation; collapse it (state is remembered) to get the menu back — the opener stays pinned top-left.
The search input permit to perfom action like:
CHILDREN will search for children pageparent_children will search for children page from the parent pageslug:hellow-world will search for page with slug being exactly tagadaslug:hellow-world OR slug:hello-me … or operatorslug:hellow-world OR pizza OR comment:HELLO-YOU …slug:%page% containing page in slugexampleTag will search in pages’s tags for exampleTag (case sensitive)comment:HELLO-YOU will search in pages’s main content for <!--HELLO-YOU--> (case sensitive)