# Erstellen eines neuen Custom Element/ Adding a new Element Setting in a Custom Block

**URL:** <https://forum.shopware.com/t/erstellen-eines-neuen-custom-element-adding-a-new-element-setting-in-a-custom-block/63886>\
**Category:** Shopware 6 (German)\
**Tags:** customelements\
**Created:** [9. Januar 2020 um 09:55 UTC](https://forum.shopware.com/t/erstellen-eines-neuen-custom-element-adding-a-new-element-setting-in-a-custom-block/63886 "2020-01-09T09:55:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdoroci](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@mdoroci](https://forum.shopware.com/u/mdoroci)\
**Post date:** [9. Januar 2020 um 09:55 UTC](https://forum.shopware.com/t/erstellen-eines-neuen-custom-element-adding-a-new-element-setting-in-a-custom-block/63886/1 "2020-01-09T09:55:52Z")

</div>

Hallo, Leute,

Ich möchte ein neues CustomElement erstellen, das ein Bild enthält.&nbsp;  
Ich habe Probleme mit der Anzeige im STOREFRONT.  
In der ADMINISTRATION funktioniert alles einwandfrei.

Was ich also gemacht habe, ist das hier:

in MyPlugin/src/Core/Content/Media/Cms/Type eine ImageHighlightTypeDataResolver.php erstellt.

![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/2X/d/d0dcd9dcc0451ac39bf6e33b41e2d388d8c92228.png)

in&nbsp;MyPlugin/src/Core/Content/DependencyInjection habe ein media.xml:

![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/2X/c/c4e6099712499144964ec3223e3862fd27d258bc.png)

Als neues Element habe ich das image-highlight&nbsp;erstellt, das nur ein Foto zeigt.  
Der index.js des image-highlight:

 ![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/2X/9/92d92cf17b00fcaf59e94f2ca31eaa04bca71384.png)

Der Config-Teil des Elements ist genau wie im Plattform Directory, das von Shopware ist:

 ![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/2X/0/0fccbd64c0f5139ade0c90bf39177d35a8c5dbc6.png)

 ![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/2X/b/bc5b7739f8a6dd531ca6b2806ed2b57b14d5ef12.png)

Die index.js des Komponenten Directory ist:&nbsp;

![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/2X/9/91f8fc7d00a13afdafde705bfd47c53818930ed3.png)

![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/2X/d/d58098e3ad0beca8c7ea75acee0c75d27f8f181d.png)

Und bis jetzt funktioniert alles gut.

**Jetzt zeigt sich das Problem in der StoreFront.**

Ich habe es so gemacht, wie es in der Plattform ist, aber es funktioniert nicht.

Storefront:

 ![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/2X/e/ed5dd71bc31a8e5ad9d37dcaeb25c775d9204057.png)

Ich werde wirklich jedem dankbar sein, der helfen kann.&nbsp;

LG,

M.D

---

<div class="post-metadata">

**Author:** ![StefanPoensgen](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/stefanpoensgen/32/14750_2.png) [@StefanPoensgen](https://forum.shopware.com/u/StefanPoensgen)\
**Post date:** [18. Januar 2020 um 22:38 UTC](https://forum.shopware.com/t/erstellen-eines-neuen-custom-element-adding-a-new-element-setting-in-a-custom-block/63886/2 "2020-01-18T22:38:23Z")

</div>

ImageHighlightTypeDataResolver.php

getType muss image-highlight zurückgeben
