# customField ohne Sanitizer

**URL:** <https://forum.shopware.com/t/customfield-ohne-sanitizer/106402>\
**Category:** Shopware 6 (German)\
**Created:** [3. Februar 2025 um 13:40 UTC](https://forum.shopware.com/t/customfield-ohne-sanitizer/106402 "2025-02-03T13:40:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![flundi81](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/flundi81/32/24725_2.png) [@flundi81](https://forum.shopware.com/u/flundi81)\
**Post date:** [3. Februar 2025 um 13:40 UTC](https://forum.shopware.com/t/customfield-ohne-sanitizer/106402/1 "2025-02-03T13:40:21Z")

</div>

Hallo,

wie kann ich ein customField Texteditor ohne den sch. Sanitizer exportieren?  
Eintrag im z-shopware.yaml funktioniert so leider nicht:

```auto
shopware:
  html_sanitizer:
    sets:
      - name: custom_fields
        fields:
          - name: product.customFields.mein_custom_field
            tags: ["p", "br", "strong"]
            attributes: ["class", "style"]

```

oder

```auto
shopware:
  html_sanitizer:
    enabled: true
    sets:
      - name: customfield_sanitizer
        tags: ["p", "br", "a", "strong", "em"]
        attributes: ["href", "target"]
        options:
          - key: HTML.Trusted
            value: true
          - key: CSS.Trusted
            value: true

```

---

<div class="post-metadata">

**Author:** ![Max\_Shop](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Max\_Shop](https://forum.shopware.com/u/Max_Shop)\
**Post date:** [3. Februar 2025 um 18:08 UTC](https://forum.shopware.com/t/customfield-ohne-sanitizer/106402/2 "2025-02-03T18:08:38Z")

</div>

> [@flundi81](#):
>
> customField Texteditor ohne den sch. Sanitizer exportieren

Was soll ein customField Texteditor sein? Was möchtest du denn von wo nach wo exportieren?

---

<div class="post-metadata">

**Author:** ![flundi81](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/flundi81/32/24725_2.png) [@flundi81](https://forum.shopware.com/u/flundi81)\
**Post date:** [4. Februar 2025 um 07:44 UTC](https://forum.shopware.com/t/customfield-ohne-sanitizer/106402/3 "2025-02-04T07:44:49Z")

</div>

![image](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/3X/1/c/1c5f0f23722b884e2b3320ed3c5bf4af3f2aec4c.png)  
Hier hab ich z.B. formatierte Texte, Tabellen usw. drin.  
Dieses möchte ich über Magnalister an z.B. Ebay übergeben, dass nur unterhalb der Beschreibung möglich ist.  
Leider schlägt da der Sanitizer zu und killt alle styles usw.  
Daher hoffte ich, ich könnte den Sanitizer auch für einzelne customFields deaktivieren.

---

<div class="post-metadata">

**Author:** ![Max\_Shop](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Max\_Shop](https://forum.shopware.com/u/Max_Shop)\
**Post date:** [4. Februar 2025 um 09:26 UTC](https://forum.shopware.com/t/customfield-ohne-sanitizer/106402/4 "2025-02-04T09:26:24Z")

</div>

Wenn er dich generell stört, wieso deaktivierst du ihn dann nicht komplett?

> **[HTML Sanitizer | Shopware Documentation](https://developer.shopware.com/docs/guides/hosting/configurations/shopware/html-sanitizer.html)**
>
> Documentation for Shopware developers

Ich weiß nicht, ob es nur Ausschnitte sind, aber deine Beispiele sehen nicht vollständig aus.

In der Symfony Dokumentation findest du weitere Einstellmöglichkeiten:

> **[HTML Sanitizer (Symfony Docs)](https://symfony.com/doc/current/html_sanitizer.html)**
>
> The HTML Sanitizer component aims at sanitizing/cleaning untrusted HTML code (e.g. created by a WYSIWYG editor in the browser) into HTML that can be trusted. It is based on the HTML Sanitizer W3C Stan…

Zum konkreten Beispiel habe ich keine Erfahrung, ob auch einzelne Felder ausgeschlossen werden können.

---

<div class="post-metadata">

**Author:** ![CWR](https://avatars.discourse-cdn.com/v4/letter/c/f0a364/32.png) [@CWR](https://forum.shopware.com/u/CWR)\
**Post date:** [4. Februar 2025 um 10:40 UTC](https://forum.shopware.com/t/customfield-ohne-sanitizer/106402/5 "2025-02-04T10:40:52Z")

</div>

Wenn das Zusatzfeld ein Snippet ist, könntest du versuchen in einer \*-shopware.yaml die Tags und Attribute für die Snippets zu erweitern.  
Hab das selbst nicht getestet, bin zur Zeit auch mit diesem Sanitizer-Thema beschäftigt. Ist eine Idee und wäre ein Versuch wert.  
Beispielhaft könnte das vielleicht so aussehen:

```auto
shopware:
  html_sanitizer:
    sets:
      - name: snippet
          tags: ["a", "table"]
          attributes: ["data-only-snippet", "cellpadding", "cellspacing"]
          custom_attributes:
            - tags: ["a", "table"]
              attributes: ["data-only-snippet"]

```

---

<div class="post-metadata">

**Author:** ![CWR](https://avatars.discourse-cdn.com/v4/letter/c/f0a364/32.png) [@CWR](https://forum.shopware.com/u/CWR)\
**Post date:** [7. Februar 2025 um 08:09 UTC](https://forum.shopware.com/t/customfield-ohne-sanitizer/106402/6 "2025-02-07T08:09:18Z")

</div>

@flundi81 Hast du den Vorschlag getestet? Würde mich interessieren.

---

<div class="post-metadata">

**Author:** ![flundi81](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/flundi81/32/24725_2.png) [@flundi81](https://forum.shopware.com/u/flundi81)\
**Post date:** [7. Februar 2025 um 09:07 UTC](https://forum.shopware.com/t/customfield-ohne-sanitizer/106402/7 "2025-02-07T09:07:23Z")

</div>

leider nicht, Kollege hat die Formatierungen der Daten geändert, dass es geht.
