# Verlinkung von Assets im eigenen Theme-Plugin

**URL:** <https://forum.shopware.com/t/verlinkung-von-assets-im-eigenen-theme-plugin/62619>\
**Category:** Themes & Design\
**Created:** [25. Oktober 2019 um 19:57 UTC](https://forum.shopware.com/t/verlinkung-von-assets-im-eigenen-theme-plugin/62619 "2019-10-25T19:57:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [25. Oktober 2019 um 19:57 UTC](https://forum.shopware.com/t/verlinkung-von-assets-im-eigenen-theme-plugin/62619/1 "2019-10-25T19:57:51Z")

</div>

Hallo,

ich habe Shopware in einem Unterordner, und ja, die /public-Pfad ist in der URL auch zu sehen (noch). Wenn ich ein Bild oder ein anderes asset im Theme verlinken will, dann nimmt er nicht den absoluten Pfad, sondern beginnt im bundle-Ordner&nbsp;relativ&nbsp; **EDIT:** absolut. Das wäre auch korrekt, aber ich betreibe den Shop später ebenfalls in einem Subordner und nicht auf der Topleveldomain.

```
{{ asset("img/meinBild.jpg" , "@Meintheme") )} = /bundles/meintheme/img/meinBild.jpg

```

Gibt es einen Weg dass ich [example.com](http://example.com) **/irgendeinpfad/** bundels/meintheme/img/meinBild.jpg betreiben kann? bzw auch noch mit pfad/public ? Danke und Gruss.

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [26. Oktober 2019 um 11:01 UTC](https://forum.shopware.com/t/verlinkung-von-assets-im-eigenen-theme-plugin/62619/2 "2019-10-26T11:01:00Z")

</div>

[@Moritz Naczenski]([http://forum.shopware.com/profile/14574/Moritz](http://forum.shopware.com/profile/14574/Moritz) Naczenski “Moritz Naczenski”)‍ kannst du das bitte in shopware 6 verschieben? Dankeschön.

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [28. Oktober 2019 um 07:50 UTC](https://forum.shopware.com/t/verlinkung-von-assets-im-eigenen-theme-plugin/62619/3 "2019-10-28T07:50:15Z")

</div>

Das ist mein aktueller Code:

**Mein theme.json:**

```
{
  "name": "Meintheme",
  "author": "Shopware AG",
  "style": [
    "@Storefront",
    "Resources/storefront/style/base.scss"
  ],
  "script": [
    "@Storefront",
    "Resources/storefront/dist/script/all.js"
  ],
  "asset": [
    "Resources/storefront/asset"
  ]
}

```

**Mein Twig:&nbsp;**

```
{{ asset('img/meinBild.jpg', '@Meintheme');

```

Rückgabe: /bundles/meintheme/img/meinBild.jpg  
Richtig wäre /bundles/meintheme/ **asset** /img/meinBild.jpg

Hat jemand eine Idee? Danke und Gruss.

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [28. Oktober 2019 um 08:36 UTC](https://forum.shopware.com/t/verlinkung-von-assets-im-eigenen-theme-plugin/62619/4 "2019-10-28T08:36:32Z")

</div>

Ok, also so wie ich das jetzt verstehe ist der eintrag **asset** im **theme.json** sinnlos? [@Michael Telgmann]([http://forum.shopware.com/profile/17553/Michael](http://forum.shopware.com/profile/17553/Michael) Telgmann “Michael Telgmann”)‍ schrieb das:&nbsp;[https://forum.shopware.com/discussion/comment/254975/#Comment\_254975](https://forum.shopware.com/discussion/comment/254975/#Comment_254975)
