- Instalation ckeditor | - Instalation ckeditor | ||||
`php bin/console ckeditor:install` | `php bin/console ckeditor:install` | ||||
`php bin/console assets:install public` | |||||
`php bin/console assets:install public | |||||
- Créer la config fos_ckeditor.yaml | |||||
``` | |||||
fos_ck_editor: | |||||
input_sync: true | |||||
default_config: base_config | |||||
configs: | |||||
base_config: | |||||
filebrowserBrowseRoute: file_manager | |||||
filebrowserBrowseRouteParameters: | |||||
conf: default | |||||
module: ckeditor | |||||
format_tags: 'p;h2;h3' | |||||
toolbar: | |||||
- { name: "styles", items: ['Bold', 'Italic','Underline', 'Strike']} | |||||
- { name: "paragraph", items: ['Format', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote'] } | |||||
- { name: "link", items: [ 'Link', 'Unlink'] } | |||||
- {name: 'insert', items: [ 'Image' ]} | |||||
- {name: 'document', items: [ 'Source' ]} | |||||
simple_config: | |||||
toolbar: | |||||
- { items: ['Bold', 'Italic', 'Underline', 'Colors', 'Source'] } | |||||
twig: | |||||
form_themes: | |||||
- '@FOSCKEditor/Form/ckeditor_widget.html.twig' | |||||
``` | |||||
- Créer la config artgris_file_manager.yaml | |||||
``` | |||||
artgris_file_manager: | |||||
conf: | |||||
default: | |||||
dir: "../public/uploads" | |||||
type: 'image' | |||||
``` | |||||
- Enjoy ! | - Enjoy ! |
{# @var field \EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto #} | {# @var field \EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto #} | ||||
{# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #} | {# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #} | ||||
{% set html_id = 'ea-lightbox-' ~ field.uniqueId %} | {% set html_id = 'ea-lightbox-' ~ field.uniqueId %} | ||||
{% if field.value is not null %} | |||||
<a href="#" class="ea-lightbox-thumbnail" title="{{ field.value.legend }}" data-featherlight="#{{ html_id }}" data-featherlight-close-on-click="anywhere"> | <a href="#" class="ea-lightbox-thumbnail" title="{{ field.value.legend }}" data-featherlight="#{{ html_id }}" data-featherlight-close-on-click="anywhere"> | ||||
<img src="{{ asset(field.value.image) }}" class="img-fluid"> | <img src="{{ asset(field.value.image) }}" class="img-fluid"> | ||||
</a> | </a> | ||||
<div id="{{ html_id }}" class="ea-lightbox"> | <div id="{{ html_id }}" class="ea-lightbox"> | ||||
<img src="{{ asset(field.value.image) }}"> | <img src="{{ asset(field.value.image) }}"> | ||||
</div> | </div> | ||||
{% endif %} |