# HTML in Snippets

**URL:** <https://forum.shopware.com/t/html-in-snippets/69189>\
**Category:** Allgemein\
**Created:** [26. August 2020 um 12:30 UTC](https://forum.shopware.com/t/html-in-snippets/69189 "2020-08-26T12:30:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![benblume](https://avatars.discourse-cdn.com/v4/letter/b/e99b99/32.png) [@benblume](https://forum.shopware.com/u/benblume)\
**Post date:** [26. August 2020 um 12:30 UTC](https://forum.shopware.com/t/html-in-snippets/69189/1 "2020-08-26T12:30:07Z")

</div>

In SW5 war es möglich in Snippets HTML und Smarty-Code zu verwenden und das wurde entsprechend geparsed.

Sehe ich das richtig, dass das in SW6 nicht mehr möglich ist? Oder gibt es da einen Trick?

Danke und Gruß,  
Ben

---

<div class="post-metadata">

**Author:** ![sschreier](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sschreier/32/23296_2.png) [@sschreier](https://forum.shopware.com/u/sschreier)\
**Post date:** [26. August 2020 um 20:54 UTC](https://forum.shopware.com/t/html-in-snippets/69189/2 "2020-08-26T20:54:58Z")

</div>

Hallo,

ist beides weiterhin möglich, siehe:&nbsp;[https://docs.shopware.com/en/shopware-platform-dev-en/theme-guide/snippets#using-your-snippets-in-your-templates](https://docs.shopware.com/en/shopware-platform-dev-en/theme-guide/snippets#using-your-snippets-in-your-templates)&nbsp;. Nur das es kein Smarty - Code ist, sondern Twig - Code.

Grüße

Sebastian

---

<div class="post-metadata">

**Author:** ![benblume](https://avatars.discourse-cdn.com/v4/letter/b/e99b99/32.png) [@benblume](https://forum.shopware.com/u/benblume)\
**Post date:** [3. September 2020 um 08:36 UTC](https://forum.shopware.com/t/html-in-snippets/69189/3 "2020-09-03T08:36:20Z")

</div>

Danke für die Antwort. Mein Problem ist allerdings, dass wenn ich HTML in Snippets verwende, das nicht als HTML gerendert wird, sondern als String ausgegeben wird. Muss ich das irgendwie escapen? Wenn ja, wie? Habe schon diverses probiert und in der Doku auch kein Beispiel dazu gefunden.

---

<div class="post-metadata">

**Author:** ![benblume](https://avatars.discourse-cdn.com/v4/letter/b/e99b99/32.png) [@benblume](https://forum.shopware.com/u/benblume)\
**Post date:** [7. September 2020 um 08:53 UTC](https://forum.shopware.com/t/html-in-snippets/69189/4 "2020-09-07T08:53:54Z")

</div>

Falls noch jemand hier landet… die Lösung ist der **raw&nbsp;** filter von Twig:  
[raw - Documentation - Twig - The flexible, fast, and secure PHP template engine](https://twig.symfony.com/doc/2.x/filters/raw.html)
