# Custom Fields - Text Editor

**URL:** <https://forum.shopware.com/t/custom-fields-text-editor/67653>\
**Category:** Programmierung\
**Created:** [15. Juni 2020 um 07:33 UTC](https://forum.shopware.com/t/custom-fields-text-editor/67653 "2020-06-15T07:33:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdsw](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mdsw](https://forum.shopware.com/u/mdsw)\
**Post date:** [15. Juni 2020 um 07:33 UTC](https://forum.shopware.com/t/custom-fields-text-editor/67653/1 "2020-06-15T07:33:37Z")

</div>

Hallo,

&nbsp;

ich würde gerne über die Custom Fields ([Shopware 6: Custom fields](https://docs.shopware.com/en/shopware-platform-dev-en/developer-guide/custom-fields)) einen Text Editor ([Shopware 6 - Settings - Custom fields](https://docs.shopware.com/en/shopware-6-en/settings/custom-fields#text-editor)) über ein Plugin einbinden. Setze ich den Custom Field Type auf HTML erscheint nur ein einzeiliges Feld. Habe nichts weiter dazu gefunden. Kann mir jemand helfen?

```
[
                'name' => 'custom_field_html_editor_text',
                'type' => 'CustomFieldTypes::HTML',
                'config' => [
                    'customFieldPosition' => 1,
                    'customFieldType' => 'html',
                    'label' => [
                        'en-GB' => 'Editor',
                        'de-DE' => 'Editor',
                    ]
                ]
            ],

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![Exe](https://avatars.discourse-cdn.com/v4/letter/e/49beb7/32.png) [@Exe](https://forum.shopware.com/u/Exe)\
**Post date:** [15. Juni 2020 um 12:27 UTC](https://forum.shopware.com/t/custom-fields-text-editor/67653/2 "2020-06-15T12:27:10Z")

</div>

Versuch mal damit unter&nbsp;config:  
{„label“: {„de-DE“: „Editor“, „en-GB“: „Editor“}, „componentName“: „sw-text-editor“, „customFieldType“: „textEditor“}

---

<div class="post-metadata">

**Author:** ![mdsw](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mdsw](https://forum.shopware.com/u/mdsw)\
**Post date:** [15. Juni 2020 um 16:07 UTC](https://forum.shopware.com/t/custom-fields-text-editor/67653/3 "2020-06-15T16:07:42Z")

</div>

Jepp, das funktioniert. Wichtig war der&nbsp;‚componentName‘ =\> ‚sw-text-editor‘.&nbsp;

Der eigentliche ‚type‘ =\> ‚CustomFieldTypes::HTML‘, kann dabei irgendwas sein, sogar&nbsp;type’ =\> ‚blubb‘.

Wieso ist das so? Wieso muss ich erst einen type angeben um dann in der config die Componente nochmals zu benennen?! Da fehlt mir jegliche Logik…&nbsp;&nbsp;Ich hab da jetzt schon alles gesehen:&nbsp;

&nbsp;

um eine Checkbox darzustellen geht **‚type‘ =\> ‚checkbox‘,**

```
'name' => 'Boolean als Checkbox V1',
'type' => 'CustomFieldTypes::BOOL',
'config' => [
    'type' => 'checkbox',
    'label' => [
        'en-GB' => 'Label',
        'de-DE' => 'Label',
    ],
],

```

&nbsp;

um eine Checkbox darzustellen geht&nbsp; **‚componentName‘ =\> ‚sw-checkbox-field‘,** allerdings auch

```
'name' => 'Boolean als Checkbox V2',
'type' => 'CustomFieldTypes::BOOL',
'config' => [
    'componentName' => 'sw-checkbox-field',
    'label' => [
        'en-GB' => 'Label',
        'de-DE' => 'Label',
    ],
],

```

&nbsp;

Um ein Select-Feld zu erstellten braucht man&nbsp; **‚componentName‘ =\> ‚sw-single-select‘,** -&nbsp; **‚customFieldType‘ =\> ‚select‘,** scheint hingegen vollkommen überflüssig.

```
'name' => 'Select',
'type' => 'CustomFieldTypes::SELECT',
'config' => [
    'customFieldType' => 'select',
    'componentName' => 'sw-single-select',
    'label' => [
        'en-GB' => 'Label',
		'de-DE' => 'Label',
    ],
    'options' => []
],

```

&nbsp;

&nbsp;

Was ist richtig, was ist falsch, wieso gibt es type, config type, component Name und customFieldType? Übersehe ich da etwas?

&nbsp;

&nbsp;
