S
S
Stanislav Shendakov2020-06-22 07:51:48
symfony
Stanislav Shendakov, 2020-06-22 07:51:48

How to show CKEditor form in show section?

Good afternoon.

Admin panel is made on Easy_admin, entity: News. The CKEditor component is connected. OrgNews.yaml content:

...
            show:
                  title: 'Смотреть новость'
                  fields:
                      - { property: 'title', type: 'string' }
                      - { property: 'image', type: 'image', label : 'Фото', is_image_url: 'true', base_path: '/uploads/'  }
                      - { property: 'short_text', type: 'text' , label: 'Текст анонса'  }
                      - { property: 'full_text', type: 'fos_ckeditor', label: 'Полный текст'  }
                      - { property: 'publish_date', type: 'date', label : 'Дата публикации' }
                      - { property: 'is_published', type: 'boolean', label : 'Опубликовано' }

                  actions: [ '-edit', '-delete' ]
...
On the edit and new forms, everything works as it should. On the show form, fields containing RTF are displayed as is (with type : 'text' ), or nothing at all is displayed with type : 'ckeditor'. What type of field should be specified, or what kind of dance should be performed so that the contents of the field are displayed taking into account the formatting and all tags? Thank you. <p>1111</p>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Deniev, 2020-08-06
@deniev

If you are talking about the output, then in the form of show.html.twig add the raw filter to the text :{{ news.full_text | raw }}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question