# Textbausteine automatisch anlegen?

**URL:** https://forum.shopware.com/t/textbausteine-automatisch-anlegen/92772
**Category:** Shopware 6 (German)
**Tags:** programming
**Created:** [4. Februar 2022 um 10:18 UTC](https://forum.shopware.com/t/textbausteine-automatisch-anlegen/92772 "2022-02-04T10:18:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)
#### Post date: [4. Februar 2022 um 10:18 UTC](https://forum.shopware.com/t/textbausteine-automatisch-anlegen/92772/1 "2022-02-04T10:18:23Z")

</div>

Von SW5 war man es gewöhnt, dass neue Textbausteine in einem Template automatisch angelegt werden. Gehe ich richtig der Annahme das dies bei SW6 nicht mehr der Fall ist?

Hintergrund der Frage: Neue Textbausteine werden in einem Plugin benötigt

---

<div class="post-metadata">

### Author: ![FSA](https://avatars.discourse-cdn.com/v4/letter/f/e9a140/32.png) [@FSA](https://forum.shopware.com/u/FSA)
#### Post date: [4. Februar 2022 um 10:55 UTC](https://forum.shopware.com/t/textbausteine-automatisch-anlegen/92772/2 "2022-02-04T10:55:17Z")

</div>

wenn ich mich recht entsinne gibt es da unterschiedliche Stellen an denen das unterschiedlich gehandhabt wird.  
Aber kann mich da auch komplett irren.

Bei Administrationsmodulen(VueJS) ist es auf jeden Fall möglich eine Snippet Datei anzugeben, aber ja dann muss man die natürlich manuell erstellen…

Alles was in Twig abläuft wird meines Wissens nach aus der Snippet Tabelle der DB gezogen. D.h. - und ich habe es nicht getestet - aber ich denke du solltest durch das Erstellen von Einträgen in dieser DB (bspw. beim aktivieren des Plugins) dies automatisieren können.

---

<div class="post-metadata">

### Author: ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)
#### Post date: [4. Februar 2022 um 11:01 UTC](https://forum.shopware.com/t/textbausteine-automatisch-anlegen/92772/3 "2022-02-04T11:01:22Z")

</div>

Ah ok, da muss ich mal forschen … Danke aber für deine Antwort!

---

<div class="post-metadata">

### Author: ![Yukana](https://avatars.discourse-cdn.com/v4/letter/y/c6cbf5/32.png) [@Yukana](https://forum.shopware.com/u/Yukana)
#### Post date: [4. Februar 2022 um 12:59 UTC](https://forum.shopware.com/t/textbausteine-automatisch-anlegen/92772/4 "2022-02-04T12:59:25Z")

</div>

Gilt auch für Template. Einzige Abweichung, der snippet Ordner wird direkt in Resources gelegt  
[https://developer.shopware.com/docs/guides/plugins/plugins/administration/adding-snippets](https://developer.shopware.com/docs/guides/plugins/plugins/administration/adding-snippets)

In Twig wird der Textbaustein dann über {{ „swag-example.general.myCustomText“ }} aufgerufen.

---

<div class="post-metadata">

### Author: ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)
#### Post date: [4. Februar 2022 um 13:15 UTC](https://forum.shopware.com/t/textbausteine-automatisch-anlegen/92772/5 "2022-02-04T13:15:39Z")

</div>

Hab schon alles gefunden 🙂
