# neuer Thumbnail-Pfad seit Update 5.1

**URL:** https://forum.shopware.com/t/neuer-thumbnail-pfad-seit-update-5-1/32011
**Category:** Programmierung
**Created:** [6. November 2015 um 11:14 UTC](https://forum.shopware.com/t/neuer-thumbnail-pfad-seit-update-5-1/32011 "2015-11-06T11:14:16Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![macxman](https://avatars.discourse-cdn.com/v4/letter/m/eada6e/32.png) [@macxman](https://forum.shopware.com/u/macxman)
#### Post date: [6. November 2015 um 11:14 UTC](https://forum.shopware.com/t/neuer-thumbnail-pfad-seit-update-5-1/32011/1 "2015-11-06T11:14:16Z")

</div>

Hallo zusammen, der Pfad zu den Thumbnails war media/image/thumbnail … Ich hole mir den Thumbnail-Pfad in meinem Plugin über das MediaServieInterface.php. Nun erhalte ich immer noch diesen oben genannten Pfad. Allerdings hat doch Shopware die gesamte Mediastruktur umgestellt. Über welches Interface erhalte ich denn nun den neuen Pfad zu den Thumbnails? Anbei ein Auszug aus meinem Plugin. [code]\<?php namespace ShopwarePlugins\RiconAdvancedProductListing\StoreFrontBundle;

use Shopware\Bundle\StoreFrontBundle\Service\ListProductServiceInterface;  
use Shopware\Bundle\StoreFrontBundle\Service\MediaServiceInterface;  
use Shopware\Bundle\StoreFrontBundle\Service\ProductServiceInterface;  
use Shopware\Bundle\StoreFrontBundle\Struct;

class ListProductService implements ListProductServiceInterface  
{  
private $service;  
private $mediaService;  
private $productService;

```
function __construct(ListProductServiceInterface $service, MediaServiceInterface $mediaService, ProductServiceInterface $productService) {
    $this->service = $service; $this-\>mediaService = $mediaService; $this-\>productService = $productService; } public function getList(array $numbers, Struct\ProductContextInterface $context) { $products = $this-\>service-\>getList($numbers, $context); $media = $this-\>mediaService-\>getProductsMedia($products, $context); $productData = $this-\>productService-\>getList($numbers, $context); foreach($numbers as $number) { if (!is\_object($products[$number])) { } else { $product = $products[$number]; if (isset($media[$number])) { $attribute = new Struct\Attribute(['images' =\> $media[$number]]); $product-\>addAttribute('ricon\_plugin\_system', $attribute); } $attributeP = new Struct\Attribute(['info' =\> $productData[$number]]); $product-\>addAttribute('ricon\_plugin\_system\_2', $attributeP); $products[$number] = $product; } } return $products; } public function get($number, Struct\ProductContextInterface $context) { $products = $this-\>getList([$number], $context); return array\_shift($products); } }[/code] Danke schon mal für eure Hilfe. Gruß Max
```

---

<div class="post-metadata">

### Author: ![TeichDatensysteme](https://avatars.discourse-cdn.com/v4/letter/t/43a26b/32.png) [@TeichDatensysteme](https://forum.shopware.com/u/TeichDatensysteme)
#### Post date: [6. November 2015 um 12:22 UTC](https://forum.shopware.com/t/neuer-thumbnail-pfad-seit-update-5-1/32011/2 "2015-11-06T12:22:28Z")

</div>

Komisches if Statement hast Du da drin … jedenfalls: [https://developers.shopware.com/developers-guide/shopware-5-upgrade-guide-for-developers/?\_ga=1.126816333.1992733016.1444991542#media-service](https://developers.shopware.com/developers-guide/shopware-5-upgrade-guide-for-developers/?%5C_ga=1.126816333.1992733016.1444991542#media-service) Immer die Dev. Guides / Changelogs im Auge behalten. Dort wird beschrieben, was Du machen musst - mit Beispielen. Schöne Grüße, Niklas

---

<div class="post-metadata">

### Author: ![macxman](https://avatars.discourse-cdn.com/v4/letter/m/eada6e/32.png) [@macxman](https://forum.shopware.com/u/macxman)
#### Post date: [6. November 2015 um 13:33 UTC](https://forum.shopware.com/t/neuer-thumbnail-pfad-seit-update-5-1/32011/3 "2015-11-06T13:33:55Z")

</div>

Hi Niklas, danke für deine Antwort und deinen Link. Da war ich gerade auch schon dran. Was ich davon auf jeden Fall benötige ist der neue smarty Tag `{media path='pfad'}` im Frontend. An einem Punkt scheiter ich jedoch noch. Ich habe den Pfad in einer Variable gespeichert. Das funktioniert aber leider nicht. Als ob die Funktion Probleme mit der Variable hat. `{media path='$path'} {media path=$path}` Vielleicht noch einen Tipp? Vielen Dank und viele Grüße Max

---

<div class="post-metadata">

### Author: ![hec](https://avatars.discourse-cdn.com/v4/letter/h/e274bd/32.png) [@hec](https://forum.shopware.com/u/hec)
#### Post date: [6. November 2015 um 16:11 UTC](https://forum.shopware.com/t/neuer-thumbnail-pfad-seit-update-5-1/32011/4 "2015-11-06T16:11:25Z")

</div>

Hallo, wenn du den Pfad eh aus deinem Plugin übergibst, lass dir doch dort gleich die vollständige URL erzeugen. vgl. [https://developers.shopware.com/develop … generation](https://developers.shopware.com/developers-guide/shopware-5-media-service/#url-generation) ` $url = $mediaService-\>getUrl($path); ` Grüße, Sven

---

<div class="post-metadata">

### Author: ![hec](https://avatars.discourse-cdn.com/v4/letter/h/e274bd/32.png) [@hec](https://forum.shopware.com/u/hec)
#### Post date: [6. November 2015 um 22:13 UTC](https://forum.shopware.com/t/neuer-thumbnail-pfad-seit-update-5-1/32011/5 "2015-11-06T22:13:06Z")

</div>

Hi, dass die {media}-Funktion mit deiner Variable nicht funktioniert, dürfte daran liegen, dass {media} den Pfad auswertet, wenn das Template kompiliert wird, deine Variable aber erst zur Laufzeit gesetzt wird. Grüße, Sven

---

<div class="post-metadata">

### Author: ![kadis](https://avatars.discourse-cdn.com/v4/letter/k/c57346/32.png) [@kadis](https://forum.shopware.com/u/kadis)
#### Post date: [25. Mai 2020 um 14:53 UTC](https://forum.shopware.com/t/neuer-thumbnail-pfad-seit-update-5-1/32011/6 "2020-05-25T14:53:53Z")

</div>

Guten Tag @macxman‍ ,

dein Beitrag ist zwar schon relativ lange her, aber ich hätte da mal eine Frage.

Wie bekommst du deinem ‘ListProductService’ Klassen-Konstrukter, welche&nbsp;‘ListProductServiceInterface’ implementiert, das ‘ListProductServiceInterface’ und ‘ProductServiceInterface’ übergeben?  
Und wie sieht dort deine services.xml aus?

Aktuell habe ich das Problem, dass ich dort immer in einer&nbsp;‘ServiceCircularReferenceException’ lande.  
(_Circular reference detected for service “light\_listing\_features.list\_product\_service”, path: “light\_listing\_features.list\_product\_service -\> shopware\_storefront.product\_service -\> light\_listing\_features.list\_product\_service”_)

Meine services.xml sieht wie folgt aus:  
&nbsp;

&nbsp;

Beste Grüße!
