# Media-Feld als Custom Field in App-Manifest (gelöst)

**URL:** <https://forum.shopware.com/t/media-feld-als-custom-field-in-app-manifest-geloest/99041>\
**Category:** Shopware 6 (German)\
**Created:** [22. März 2023 um 12:35 UTC](https://forum.shopware.com/t/media-feld-als-custom-field-in-app-manifest-geloest/99041 "2023-03-22T12:35:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![area-net-gmbh](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/area-net-gmbh/32/21995_2.png) [@area-net-gmbh](https://forum.shopware.com/u/area-net-gmbh)\
**Post date:** [22. März 2023 um 12:35 UTC](https://forum.shopware.com/t/media-feld-als-custom-field-in-app-manifest-geloest/99041/1 "2023-03-22T12:35:59Z")

</div>

Ich entwickle gerade an einer App. Über die Manifest-Datei kann ich ja relativ einfach Zusatzfelder erstellen, z.B.

```auto
<custom-fields>
        <custom-field-set>
            <name>name</name>
            <label>label</label>
            <related-entities>
                <category/>
            </related-entities>
            <fields>
                <bool name="foo">
                    <position>1</position>
                    <label>bar</label>
                </bool>
            </fields>
        </custom-field-set>
</custom-fields>

```

In der Doku finde ich leider nicht, ob oder wie ein Media-Feld (zum Upload und/oder Auswahl eines Bildes) als Zusatzfelds in Apps erstellt werden kann. Folgender Ansatz funktioniert leider nicht:

```auto
<custom-field-set>
            ...
            <related-entities>
                <category/>
            </related-entities>
            <fields>
           
                <many-to-one name="vendorname-image" reference="media" store-api-aware="true" on-delete="set-null" >
                    <position>2</position>
                    <label>Image for megamenu</label>
                    <label lang="de-DE">Bild für Megamenü</label>
                </many-to-one>
            </fields>
        </custom-field-set>

```

---

<div class="post-metadata">

**Author:** ![area-net-gmbh](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/area-net-gmbh/32/21995_2.png) [@area-net-gmbh](https://forum.shopware.com/u/area-net-gmbh)\
**Post date:** [22. März 2023 um 15:47 UTC](https://forum.shopware.com/t/media-feld-als-custom-field-in-app-manifest-geloest/99041/2 "2023-03-22T15:47:34Z")

</div>

Hier die richtige Verwendung - ist in der Doku zu Apps schwer (bis gar nicht?) zu finden.

```auto
<manifest ...>
    <custom-fields>
        <custom-field-set>
            <name>swag_example_set</name>
            <label>Example Set</label>
            <related-entities>
                <category/>
            </related-entities>
            <fields>
                <media-selection name="vendorname_image">
                    <position>2</position>
                    <label>Image for megamenu</label>
                    <label lang="de-DE">Bild für Megamenü</label>
                </media-selection>
            </fields>
        </custom-field-set>
    </custom-fields>
</manifest>

```
