# JavaScript im neuen Plugin System 5.2

**URL:** <https://forum.shopware.com/t/javascript-im-neuen-plugin-system-5-2/46119>\
**Category:** Allgemein\
**Created:** [2. Juni 2017 um 08:15 UTC](https://forum.shopware.com/t/javascript-im-neuen-plugin-system-5-2/46119 "2017-06-02T08:15:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kerstin83](https://avatars.discourse-cdn.com/v4/letter/k/49beb7/32.png) [@Kerstin83](https://forum.shopware.com/u/Kerstin83)\
**Post date:** [2. Juni 2017 um 08:15 UTC](https://forum.shopware.com/t/javascript-im-neuen-plugin-system-5-2/46119/1 "2017-06-02T08:15:09Z")

</div>

Liebes Forum 🙂 🙂

Wie bindet man im neuen Pluginsystem in Shopware 5.2 Javascript ein ?

Less-Dateien bindet man ja z.B. so ein:

```
 'onFrontendPostDispatchBlog',
            'Theme_Compiler_Collect_Plugin_Less' => 'onCollectLessFiles'
        ];
    }

    public function onCollectLessFiles()
    {
        
        return new LessDefinition(
            [],
            [$this->getPath() . '/Resources/Views/frontend/_public/src/less/all.less']
        );
    }    
   
    
    public function onFrontendPostDispatchBlog(\Enlight_Controller_ActionEventArgs $args)
    {
        $this->container->get('template')->addTemplateDir( $this->getPath() . '/Resources/Views/' );
    }
}

```

Ich habe mal etwas analoges versucht, nur leider ohne Erfolg ☹

Wie macht man das ?

Liebe Grüße

Kerstin 🙂

---

<div class="post-metadata">

**Author:** ![iLuHa](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/iluha/32/8191_2.png) [@iLuHa](https://forum.shopware.com/u/iLuHa)\
**Post date:** [2. Juni 2017 um 08:24 UTC](https://forum.shopware.com/t/javascript-im-neuen-plugin-system-5-2/46119/2 "2017-06-02T08:24:31Z")

</div>

Guck mal hier:&nbsp;[https://forum.shopware.com/discussion/40464/js-datei-in-plugin-einbinden](https://forum.shopware.com/discussion/40464/js-datei-in-plugin-einbinden) 🙂

---

<div class="post-metadata">

**Author:** ![Kerstin83](https://avatars.discourse-cdn.com/v4/letter/k/49beb7/32.png) [@Kerstin83](https://forum.shopware.com/u/Kerstin83)\
**Post date:** [2. Juni 2017 um 09:28 UTC](https://forum.shopware.com/t/javascript-im-neuen-plugin-system-5-2/46119/3 "2017-06-02T09:28:10Z")

</div>

Vielen Dank. Das hat endlich geklappt \*freu.

Gibt es eigentlich irgendwo ein paar Beispielplugins des neuen Plugin-Systems ?

Liebe Grüße

Kerstin

---

<div class="post-metadata">

**Author:** ![sschreier](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sschreier/32/23296_2.png) [@sschreier](https://forum.shopware.com/u/sschreier)\
**Post date:** [2. Juni 2017 um 09:46 UTC](https://forum.shopware.com/t/javascript-im-neuen-plugin-system-5-2/46119/4 "2017-06-02T09:46:50Z")

</div>

Hallo,

prinzipiell nur hier ganz unten: [https://developers.shopware.com/developers-guide/plugin-system/#example-plugins](https://developers.shopware.com/developers-guide/plugin-system/#example-plugins) .

Alternativ gibt es ja auch im Shopware Buch ein ausführlich beschriebenes Plugin auf Basis des Pluginsystems von Shopware 5.2.

Beste Grüße

Sebastian

---

<div class="post-metadata">

**Author:** ![Kerstin83](https://avatars.discourse-cdn.com/v4/letter/k/49beb7/32.png) [@Kerstin83](https://forum.shopware.com/u/Kerstin83)\
**Post date:** [2. Juni 2017 um 09:56 UTC](https://forum.shopware.com/t/javascript-im-neuen-plugin-system-5-2/46119/5 "2017-06-02T09:56:25Z")

</div>

Danke.

Das sind leider alles relativ umfangreiche Plugins. Es fehlen kleine simple Plugins, die einzelne Aspekte erklären (wie die Beispielplugins für sw 4 oder auch sw 5).

Der ganz einfache Fall, wie man einzelne Templatedateien bzw. Blöcke überschreibt und wie man Less und JS einbindet wird im Buch leider nicht so genau beschrieben. Da wird direkt ein neuer Controller gebaut.&nbsp;Mag versteckt irgendwo enthalten sein…

Liebe Grüße

Kerstin
