Skip to content

Commit 50fe4fd

Browse files
authored
Merge pull request #391 from em411/fix/ckeditor-remove-icons
Update docs and fix CKEditor configuration
2 parents a9281d8 + 900cfc0 commit 50fe4fd

4 files changed

Lines changed: 28 additions & 2 deletions

File tree

doc/installation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Since FOSCKEditorBundle 2.0, to make Twig render the WYSIWYG editor, you must ad
2929
twig:
3030
form_themes:
3131
- '@FOSCKEditor/Form/ckeditor_widget.html.twig'
32+
- '@BitBagSyliusCmsPlugin/Form/ckeditor_widget.html.twig'
3233
```
3334
3435
Import required config in your `config/packages/_sylius.yaml` file:

doc/wysiwyg.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,32 @@
22

33
This plugin comes with a default [FOSCKEditorBundle](https://github.com/FriendsOfSymfony/FOSCKEditorBundle) integration.
44
It has also been customized to use image upload feature. Every time you upload an image in the CKEditor, a new image media
5-
is being created.
5+
is being created.
66

77
## General usage
88

99
You can use a custom [WysiwygType](../src/Form/Type/WysiwygType.php) any place you want the CKEditor to appear in.
1010
Take [the BlockTranslationType](../src/Form/Type/Translation/BlockTranslationType.php) as an example.
1111

1212
**Note:**
13-
1413
*In the WYSIWYG fields, you can use Twig function nesting. Read more [here](twig-functions-in-admin.md).*
14+
15+
## Configuration
16+
17+
If you want to customize any behavior of the CKEditor, you have to override one of these files: [CKEditor config](../src/Resources/config/fos_ck_editor/fos_ck_editor.yml) or [CKEditor js config](../src/Resources/views/Form/ckeditor_widget.html.twig)
18+
19+
**Useful links:**
20+
- [CKEditor configuration](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html)
21+
- [CKEditor DTD configuration](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_dtd.html)
22+
23+
24+
**Note:**
25+
Remember to add your js configuration to `config/packages/twig.yaml` file:**
26+
```yaml
27+
# Symfony 2/3: app/config/config.yml
28+
# Symfony 4: config/packages/twig.yaml
29+
30+
twig:
31+
form_themes:
32+
- 'path to your configuration'
33+
```
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{% extends "@FOSCKEditor/Form/ckeditor_widget.html.twig" %}
2+
3+
{% block ckeditor_widget_extra %}
4+
CKEDITOR.dtd.$removeEmpty['i'] = false;
5+
{% endblock %}

tests/Application/config/packages/twig.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ twig:
44
strict_variables: '%kernel.debug%'
55
form_themes:
66
- '@FOSCKEditor/Form/ckeditor_widget.html.twig'
7+
- '@BitBagSyliusCmsPlugin/Form/ckeditor_widget.html.twig'
78

89
services:
910
_defaults:

0 commit comments

Comments
 (0)