layout_paragraphs_split
Allows to easily "insert" a new structured component (a Layout Paragraph) "into" a text.
Actually, it's a button in the rich-text editor toolbar (CKE5) which splits a paragraph containing a text field into two similar ones containing the beginning and the end of the initial HTML text, then triggers the button to add a new paragraph in-between.
It's especially useful for people copying their text from elsewhere, who then want to "enrich" their text by adding structured content in-between.
Post-Installation
After the module has been installed as usual, edit the editor config of your text format to add the new toolbar button.
Then, on paragraph-reference fields which use the Layout Paragraphs widget, the button will appear in the CKE5 toolbar when you edit a paragraph with a rich-text field.
If you click on it when your text editor cursor is somewhere in the text, it will automagically do what you could do manually:
- Cut the part of the text which is after the cursor
- Close the paragraph edit dialog
- Duplicate the paragraph to create a new one below
- Edit that new paragraph to paste in it the part which was cut before
- Close the paragraph edit dialog
- Click the "add" button between the initial paragraph and the new one, to create some new paragraph of any type allowed in your reference field
It has been tested with a simple paragraph type containing only one rich-text field, which is the common need. It might behave unexpectedly if you try to split a paragraph type containing several CKE5 fields.
Additional Requirements
Core CKEditor5 module
Layout Paragraphs
Similar projects
Paragraph Features: contains a split feature which was the inspiration for this one. Not-as-good editor experience because it doesn't work with Layout Paragraphs and it only splits, you have to click one more time to add in-between.
The same kind of need can be obtained with Paragraphs Entity Embed or Paragraphs Inline Entity Form, but their data storage is very different. In these modules, the paragraph reference is stored inside the rich text field value. The resulting content structure can be seen as less standard/future-proof, there might be incompatibilities with other modules, and a more difficult use of this content in custom code and in external systems consuming the data.
This feature might be part of Core Experience Builder in the future, but for now Experience Builder is not available.