Skip to content

Commit

Permalink
Update 40_WYSIWYG.md (#16177)
Browse files Browse the repository at this point in the history
LGTM
  • Loading branch information
j-jonas committed Nov 2, 2023
1 parent 52e492d commit c6fd5ac
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion doc/03_Documents/01_Editables/40_WYSIWYG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@

Similar to Textarea and Input you can use the WYSIWYG editable in the templates to provide rich-text editing. TinyMce is installed by default in our demo. Another editor can be installed via the wysiwyg-events you find in `events.js`

## Enable TinyMce

Add the bundle in your `config/bundles.php` file:

```php
\Pimcore\Bundle\TinymceBundle\PimcoreTinymceBundle::class => ['all' => true],
```

After this, make sure PimcoreTinymceBundle is installed with `bin/console pimcore:bundle:list`.
If it is not installed, you can install it with `bin/console pimcore:bundle:install PimcoreTinymceBundle`.

## Add a Custom Editor
Make sure that you add the Editor to `pimcore.wysiwyg.editors`. This array can be used to have different editors for different use cases(documents, objects ...):
```javascript
Expand Down Expand Up @@ -55,4 +66,4 @@ framework:
If you want to adapt this configuration please have a look at the [symfony documentation](https://symfony.com/doc/current/html_sanitizer.html). Add your custom configuration to you project, e.g. to `config/packages/html_sanitizer.yaml`

> Note: When using API to set WYSIWYG data, please pass encoded characters for html entities e.g. <,>, & etc.
> The data is encoded by the sanitizer before persisting into db and the same encoded data will be returned by the API.
> The data is encoded by the sanitizer before persisting into db and the same encoded data will be returned by the API.

0 comments on commit c6fd5ac

Please sign in to comment.