# Freitextfeld Media

**URL:** <https://forum.shopware.com/t/freitextfeld-media/46928>\
**Category:** Themes & Design\
**Created:** [14. Juli 2017 um 13:53 UTC](https://forum.shopware.com/t/freitextfeld-media/46928 "2017-07-14T13:53:24Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![medienagenturmadco](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@medienagenturmadco](https://forum.shopware.com/u/medienagenturmadco)\
**Post date:** [18. Juli 2017 um 10:32 UTC](https://forum.shopware.com/t/freitextfeld-media/46928/4 "2017-07-18T10:32:05Z")

</div>

erstell dir einfach ein smarty modifier mit folgendem Inhalt

deinTemplate\_private\smarty\modifier.mediaurl.php

```
Models()->getRepository('Shopware\Models\Media\Media')->findOneBy(['id' => $id]);
        if ($media) {
            $path = $media->getPath();

            $mediaUrl = Shopware()->Container()->get('shopware_media.media_service')->getUrl($path);

            return $mediaUrl;
        }
    }

}

```

Aufruf im Template dann mit

```
{$sArticle.attr5|mediaurl}

```

&nbsp;

---

_[View the full topic](https://forum.shopware.com/t/freitextfeld-media/46928)._
