I created a custom entity "event" for a small event management module. This entity has several fields including a field "description". This field should mimic the behaviour of the nodes "body" field.
The BaseFieldDefinition:
$fields['description'] = BaseFieldDefinition::create('text_with_summary')
->setRevisionable(TRUE)
->setLabel(t('Description'))
->setDisplayOptions('form', [
'type' => 'text_textarea_with_summary',
'weight' => 10,
])
->setDisplayConfigurable('form', TRUE)
->setDisplayOptions('view', [
'type' => 'text_default',
'label' => 'above',
'weight' => 10,
])
->setDisplayConfigurable('view', TRUE);
When I create a new event, everything works fine. I have CKEditor working and when I save and view the event everything works fine.
The problems begin when I work with views.
I create a view based on the event entity in table layout. When I add fields, I can now choose the description field three times:
- Description
- Description (format)
- Description (summary)
All three field produce the same output. And all outputs show plain HTML output. The same happens for fields created via the "fields" tab on the event entity trough the ui.
How can I achieve, that the WYSIWYG fields behave the same like the ones attached to the node entities?