Skip to content

Commit

Permalink
MAGETWO-90214 Configure TinyMCE editor (magento#1892)
Browse files Browse the repository at this point in the history
Added new page, configure-tinymce-editor.md, and added in nav in WYSIWYG directory.
  • Loading branch information
shrielenee authored Apr 19, 2018
1 parent 10ee933 commit f1b31d4
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
11 changes: 7 additions & 4 deletions _data/toc/ui-components-guide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,18 +163,21 @@ pages:
- label: WYSIWYG component
versions: ["2.0","2.1","2.2"]
url: ui_comp_guide/components/ui-wysiwyg.html

- label: WYSIWYG component
versions: "2.3"
url: ui_comp_guide/components/ui-wysiwyg.html
children:

- label: Extension Points
url: ui_comp_guide/components/wysiwyg/extension-points/

- label: Add Custom Editor
url: ui_comp_guide/components/wysiwyg/add-custom-editor/

- label: Configure the TinyMCE editor
url: ui_comp_guide/components/wysiwyg/configure-tinymce-editor.html

- label: Extension Points
url: ui_comp_guide/components/wysiwyg/extension-points/

- label: Concepts
children:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
layout: default
subgroup: howtos
group: UI_Components_guide
title: Configure the TinyMCE editor
version: 2.3
github_link: ui_comp_guide/howto/configure-tinymce-editor.md
---
You can extend and fully customize the TinyMCE editor to match the style and look-and-feel of your custom theme.
This enables richer content editing capabilities and ensures that content created in the Page Builder <span term-uuid="98cf4fd5-59b6-4610-9c1f-b84c8c0abd97" class="glossary-term" data-toggle="popover">WYSIWYG</span> is seamlessly integrated and consistent with your other content.

## Edit the module's `di.xml` file {#edit-di}

Revise the `di.xml` file, adding the configuration settings as an argument to `Magento\PageBuilder\Model\Wysiwyg\DefaultConfigProvider`, to customize the TinyMCE editor present in Page Builder.

The following code shows an example of configuration settings in the `di.xml` file that determine the font sizes available for selection and add a paragraph menu option associated with the `<p>` tag:

```
<type name="Magento\PageBuilder\Model\Wysiwyg\DefaultConfigProvider">
<arguments>
<argument name="additionalSettings" xsi:type="array">
<item name="fontsize_formats" xsi:type="string">10px 12px 14px 16px 18px 20px 24px 26px 28px 32px 34px 36px 38px 40px 42px 48px 52px 56px 64px 72px</item>
<item name="style_formats" xsi:type="array">
<item name="paragraph" xsi:type="array">
<item name="title" xsi:type="string">Paragraph</item>
<item name="block" xsi:type="string">p</item>
</item>
</item>
</argument>
</arguments>
</type>
```
See a list of possibly TinyMCE settings on their [website](https://www.tinymce.com/docs/configure/).

Once you have edited the `di.xml` file you can apply custom styling for the settings you implemented in the related CSS file.

0 comments on commit f1b31d4

Please sign in to comment.