# Template laden innerhalb der modal box

**URL:** <https://forum.shopware.com/t/template-laden-innerhalb-der-modal-box/26184>\
**Category:** Themes & Design\
**Created:** [11. April 2015 um 09:39 UTC](https://forum.shopware.com/t/template-laden-innerhalb-der-modal-box/26184 "2015-04-11T09:39:37Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![tomgla](https://avatars.discourse-cdn.com/v4/letter/t/87869e/32.png) [@tomgla](https://forum.shopware.com/u/tomgla)\
**Post date:** [27. Juli 2022 um 08:27 UTC](https://forum.shopware.com/t/template-laden-innerhalb-der-modal-box/26184/11 "2022-07-27T08:27:32Z")

</div>

Sorry fürs Ausgraben, aber das hier ist das Top-Ergebnis bei der Google-Suche nach „shopware 5 modal tpl laden“. Vielleicht hilft es ja noch jemandem, der wie wir noch mit Version 5 unterwegs ist.  
Wie [hier](https://forum.shopware.com/t/content-in-eine-modalbox-laden-keine-shopseite-kein-iframe/49848/3) schon richtig vermutet, muss man den Content escapen.  
Habe das Ganze jetzt so gelöst:

```auto
{include file="frontend/detail/content/popup.tpl" assign="modalContentTpl"}
{$popupData = 'foobar'}
<div data-modalBox="true" data-targetSelector="#openModal" data-content="{$modalContentTpl|escape}">
    <div id="openModal">Popup öffnen</div>
</div>

```

So kann ich Variablen aus dem Template, in dem dieser Schnipsel steht, auch im inkludierten Template verwenden (im Beispiel $popupData).  
Dass ich den Inhalt der tpl-Datei in eine Variable ($modalContentTpl) gepackt habe, hat den einfachen Grund, dass es mir sonst in VS Code die Formatierung zerhaut (offensichtlich wegen den Quotes).

---

_[View the full topic](https://forum.shopware.com/t/template-laden-innerhalb-der-modal-box/26184)._
