You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/code/Magento/PageBuilder/docs/inline-editing-component.md
+95-26Lines changed: 95 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -58,14 +58,16 @@
58
58
[How to create custom PageBuilder content type container]: how-to-create-custom-content-type-container.md
59
59
60
60
## What's in this topic
61
-
This topic describes how to add a reusable inline text editing text component to the PageBuilder stage for a content type.
61
+
62
+
This topic describes how to add a reusable inline text editing component to the PageBuilder stage for a content type.
62
63
63
64
## Overview
64
65
65
66
To add inline editing customization to PageBuilder:
66
67
1.[Add configuration for the inline editor](#add-configuration-for-the-inline-text-editor)
67
68
2.[Update the `<YourModule>/view/adminhtml/web/js/content-type/<content_type_name>/preview.js` file](#update-the-yourmoduleviewadminhtmlwebjscontent-typecontent_type_namepreviewjs-file-js-file)
68
69
3.[Update the preview template to display the inline editor component](#update-the-preview-template-to-display-the-inline-text-editor-component)
70
+
4.[Extend the component](#extend-the-component) (optional)
69
71
70
72
## Add configuration for the inline text editor
71
73
@@ -79,9 +81,6 @@ To add configuration for the inline text editor:
If you are creating a custom content type, however, use an existing content type that already implements a WYSIWYG as your template. `Magento_PageBuilder/js/content-type/text` can be used as a reference for injecting the required inline text editor dependency into your own custom content type:
116
+
If you are creating a custom content type, however, use an existing content type that already implements a WYSIWYG as your template. `Magento_PageBuilder/js/content-type/text` can be used as a reference for injecting the required inline text editor dependency into your own custom content type via `Magento_PageBuilder/js/content-type/wysiwyg/factory`:
114
117
115
118
``` js
116
-
/**
117
-
* @param{HTMLElement}element
118
-
*/
119
-
publicinitWysiwyg(element:HTMLElement) {
120
-
if (!Config.getConfig("can_use_inline_editing_on_stage")) {
2. Specify the name of a preferred editor, as noted in the system configuration path `cms/wysiwyg/editor`.
194
+
195
+
This configuration can be specified for every editor that is supported for display on the inline editing mode on the stage. `factory` then returns the WYSIWYG instance referenced in your current Magento configuration.
196
+
197
+
3. Specify the `component_initializers`, per content type, where the inline text editor component will be used. Within this configuration, you can extend the existing event logic:
The following events can be extended for the default TinyMCE4 editor:
214
+
- `onFocus`
215
+
- `onBlur`
216
+
- `afterChangeContent`
217
+
218
+
4. Specify the list of modifers, `config_modifiers`, that can update the WYSIWYG configuration before the component is initialized. These configuration keys can also be used to update the default WYSIWYG editor (TinyMCE4).
219
+
5. Specify the `mode` in which TinyMCE4 will be rendered on the stage.
220
+
6. Specify the `minToolbarWidth` to limit the width of TinyMCE4. If a component is used with a content type configured to a small width, this will limit the width to match.
221
+
7. Specify the `parentSelectorsToUnderlay` for TinyMCE4 to utilize an array of selectors for applying the z-index, which will prevent the toolbar from overlaying content type elements.
0 commit comments