# Template-Snippets s name=$stringVar funktioniert nicht

**URL:** <https://forum.shopware.com/t/template-snippets-s-name-stringvar-funktioniert-nicht/40856>\
**Category:** Programmierung\
**Created:** [26. Oktober 2016 um 15:26 UTC](https://forum.shopware.com/t/template-snippets-s-name-stringvar-funktioniert-nicht/40856 "2016-10-26T15:26:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![akdes](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@akdes](https://forum.shopware.com/u/akdes)\
**Post date:** [26. Oktober 2016 um 15:26 UTC](https://forum.shopware.com/t/template-snippets-s-name-stringvar-funktioniert-nicht/40856/1 "2016-10-26T15:26:34Z")

</div>

Hallo all

kann mir jemand den Unterschied erklären?&nbsp;

```
{s name="snippet"}{/s}

```

und

```
{assign var=test value="snippet"}
{s name=$test}{/s}

```

&nbsp;

Denn die erste Variante funktioniert, die zweite nicht.&nbsp;

Wäre für eine funktionierende Lösung mit einer Variable sehr dankbar.&nbsp;

&nbsp;

vielen Dank im Voraus!&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![EikeBrandtWarneke](https://avatars.discourse-cdn.com/v4/letter/e/cdc98d/32.png) [@EikeBrandtWarneke](https://forum.shopware.com/u/EikeBrandtWarneke)\
**Post date:** [26. Oktober 2016 um 15:37 UTC](https://forum.shopware.com/t/template-snippets-s-name-stringvar-funktioniert-nicht/40856/2 "2016-10-26T15:37:22Z")

</div>

Du suchst:

```
 {$snippetName = "derName"} {"Der Textbaustein"|snippet:$snippetName:"mein/namespace"} 

```

Viele Grüße

---

<div class="post-metadata">

**Author:** ![akdes](https://avatars.discourse-cdn.com/v4/letter/a/9f8e36/32.png) [@akdes](https://forum.shopware.com/u/akdes)\
**Post date:** [26. Oktober 2016 um 15:42 UTC](https://forum.shopware.com/t/template-snippets-s-name-stringvar-funktioniert-nicht/40856/3 "2016-10-26T15:42:15Z")

</div>

Vielen Dank, hilft mir sehr weiter!&nbsp;
