Browse Source

Fix error admin

develop
Fab 3 years ago
parent
commit
9a131b7fa8
2 changed files with 39 additions and 1 deletions
  1. +37
    -1
      README.md
  2. +2
    -0
      Resources/views/crud/field/image.html.twig

+ 37
- 1
README.md View File

@@ -31,7 +31,43 @@ Si tu démarres un nouveau projet il te suffit de cloner le projet : https://git
- Instalation ckeditor
`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 !

+ 2
- 0
Resources/views/crud/field/image.html.twig View File

@@ -2,6 +2,7 @@
{# @var field \EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto #}
{# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #}
{% 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">
<img src="{{ asset(field.value.image) }}" class="img-fluid">
</a>
@@ -9,3 +10,4 @@
<div id="{{ html_id }}" class="ea-lightbox">
<img src="{{ asset(field.value.image) }}">
</div>
{% endif %}

Loading…
Cancel
Save