# Thumbnail für Eigenschaft ausgeben? SOLVED

**URL:** <https://forum.shopware.com/t/thumbnail-fur-eigenschaft-ausgeben-solved/51885>\
**Category:** Themes & Design\
**Created:** [20. März 2018 um 11:43 UTC](https://forum.shopware.com/t/thumbnail-fur-eigenschaft-ausgeben-solved/51885 "2018-03-20T11:43:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielmorfer](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@danielmorfer](https://forum.shopware.com/u/danielmorfer)\
**Post date:** [20. März 2018 um 11:43 UTC](https://forum.shopware.com/t/thumbnail-fur-eigenschaft-ausgeben-solved/51885/1 "2018-03-20T11:43:01Z")

</div>

Hallo, ich versuche im Template auf einer Übersichtsseite der Artikel nur die jeweilige Eigenschaft “Muster” auszugeben.

Dort ist immer ein Bild für die Eigenschaft hinterlegt. Wie komme ich an das Thumbnail ran? Ich habe für die Bilder schon ein Thumbnail in 300x300 generiert.

Soweit bin ich schon:

```
...

{foreach $facet->getFacetResults() as $facetResult}
         
         {foreach $facetResult->getValues() as $option}
         

{if $option->getMedia()}

{$thumbs = $option->getMedia()->getThumbnails()}
{$thumbs.0|@print_r}

{/if}

...

```

Spuckt mir dann folgendes aus:

```
Shopware\Bundle\StoreFrontBundle\Struct\Thumbnail Object
(
[source:protected] => https://www.domain.de/media/image/ab/20/8d/artikelbild_300x300.jpg
[retinaSource:protected] =>
[maxWidth:protected] => 300
[maxHeight:protected] => 300
[attributes:protected] => Array
(
)
)

```

Wie komme ich den Wert “source”? Gibt es eine Funktion dafür, wie z.B. getThumbnailPath()?

Mit {$thumbs.0.source} oder {$thumbs.0-\>get(‘source’)} geht es nicht.

LG Daniel

---

<div class="post-metadata">

**Author:** ![danielmorfer](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@danielmorfer](https://forum.shopware.com/u/danielmorfer)\
**Post date:** [25. März 2018 um 19:22 UTC](https://forum.shopware.com/t/thumbnail-fur-eigenschaft-ausgeben-solved/51885/2 "2018-03-25T19:22:59Z")

</div>

Muss noch mal pushen. Hat jemand einen Tip?

---

<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:** [25. März 2018 um 20:14 UTC](https://forum.shopware.com/t/thumbnail-fur-eigenschaft-ausgeben-solved/51885/3 "2018-03-25T20:14:03Z")

</div>

Siehe&nbsp;[shopware/Thumbnail.php at 5.4 · shopware/shopware · GitHub](https://github.com/shopware/shopware/blob/5.4/engine/Shopware/Bundle/StoreFrontBundle/Struct/Thumbnail.php)

Viele Grüße

---

<div class="post-metadata">

**Author:** ![danielmorfer](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@danielmorfer](https://forum.shopware.com/u/danielmorfer)\
**Post date:** [25. März 2018 um 21:03 UTC](https://forum.shopware.com/t/thumbnail-fur-eigenschaft-ausgeben-solved/51885/4 "2018-03-25T21:03:02Z")

</div>

```
{if $option->getMedia()->getThumbnails()}
{$mediaFile = $option->getMedia()->getThumbnails()}
{$mediaFile = $mediaFile.0->getSource()}
{else}
{$mediaFile = $option->getMedia()->getFile()}
{/if}

```

Super vielen Dank! Das wars.

&nbsp;
