# Is it possible (atm) to override or better extend an existing element via plugin?

**URL:** https://forum.shopware.com/t/is-it-possible-atm-to-override-or-better-extend-an-existing-element-via-plugin/65630
**Category:** Programming (EN)
**Tags:** customelements
**Created:** [20. März 2020 um 10:32 UTC](https://forum.shopware.com/t/is-it-possible-atm-to-override-or-better-extend-an-existing-element-via-plugin/65630 "2020-03-20T10:32:11Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ralfh](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@ralfh](https://forum.shopware.com/u/ralfh)
#### Post date: [20. März 2020 um 10:32 UTC](https://forum.shopware.com/t/is-it-possible-atm-to-override-or-better-extend-an-existing-element-via-plugin/65630/1 "2020-03-20T10:32:11Z")

</div>

I want to override or extend the element “image” ("…administration/src/module/sw-cms/elements/image"). Is it possible at the moment? First I want to extend or override the …/config/sw-cms-el-config-image.html.twig template, so I created the file in my plugin (MyPlugin/src/Resources/app/administration/src/module/sw-cms/elements/image/config/), but with no effect.

```
{% block sw_cms_element_image_config %}
    test...
{% endblock %}

```

&nbsp;

---

<div class="post-metadata">

### Author: ![rjanits](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@rjanits](https://forum.shopware.com/u/rjanits)
#### Post date: [19. November 2022 um 14:55 UTC](https://forum.shopware.com/t/is-it-possible-atm-to-override-or-better-extend-an-existing-element-via-plugin/65630/2 "2022-11-19T14:55:48Z")

</div>

Hello, I just had the same problem.  
It’s possible to extend or overwrite an existing CMS elements config. Depends if your overwrite the config twig file or extend it with `{% parent %}`.

For your changes to be applied you also need to create an index.js in which you override the existing JS component… and after that rebuild the administration with following command.

```auto
./bin/build-administration.sh

```

**yourPlugin/src/Resources/app/administration/src/module/sw-cms/elements/image/index.js**

```auto
import template from './config/sw-cms-el-config-image.html.twig'
const { Component } = Shopware;

Component.override('sw-cms-el-config-image', {
    template
});

```

**yourPlugin/src/Resources/app/administration/src/module/sw-cms/elements/image/config/sw-cms-el-config-image.html.twig**

```auto
{% block sw_cms_element_image_config %}

    {% parent %}
    ...

{% endblock %}

```

Best regards  
Reinhard
