# Plugin Erstellung: LESS lässt sich nicht laden

**URL:** https://forum.shopware.com/t/plugin-erstellung-less-lasst-sich-nicht-laden/33831
**Category:** Programmierung
**Created:** [22. Januar 2016 um 13:05 UTC](https://forum.shopware.com/t/plugin-erstellung-less-lasst-sich-nicht-laden/33831 "2016-01-22T13:05:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![hubix](https://avatars.discourse-cdn.com/v4/letter/h/e47c2d/32.png) [@hubix](https://forum.shopware.com/u/hubix)
#### Post date: [22. Januar 2016 um 13:05 UTC](https://forum.shopware.com/t/plugin-erstellung-less-lasst-sich-nicht-laden/33831/1 "2016-01-22T13:05:19Z")

</div>

Hallo! Ich habe wie [hier im Absatz “Less”](https://developers.shopware.com/developers-guide/shopware-5-plugin-update-guide/?%5C_ga=1.110411269.1236985686.1444899439) beschrieben, versucht über all.less eine less-Datei für ein Plugin aufzurufen. In der Bootstrap.php steht drin: ` private function subscribeEvents() { // Subscribe the needed event for less merge and compression $this-\>subscribeEvent( 'Theme\_Compiler\_Collect\_Plugin\_Less', 'addLessFiles' ); } /\*\* \* Provide the file collection for less \* \* @param Enlight\_Event\_EventArgs $args \* @return \Doctrine\Common\Collections\ArrayCollection \*/ public function addLessFiles(Enlight\_Event\_EventArgs $args) { $less = new \Shopware\Components\Theme\LessDefinition( //configuration array(), //less files to compile array( \_\_DIR\_\_ . '/Views/frontend/\_public/src/less/all.less' ), //import directory \_\_DIR\_\_ ); return new Doctrine\Common\Collections\ArrayCollection(array($less)); } ` In der all.less steht drin: `@import "\_modules/name-der-datei";` In der name-der-datei.less steht bisschen CSS: ` .container { display: block; height: 50px; width: 50px; background-color: red; }` Ich habe auch schon andere Einbindungsmöglichkeiten versucht, aber egal was ich versuche, es klappt einfach nicht ☹ Wenn ich das CSS per in die index.tpl mit reinsetze, dann klappt es. Also am sonstigen Plugin-Code kann es nicht liegen, vermute ich. Nur das Einbinden vom LESS geht nicht. Was mache ich nur falsch?

---

<div class="post-metadata">

### Author: ![hubix](https://avatars.discourse-cdn.com/v4/letter/h/e47c2d/32.png) [@hubix](https://forum.shopware.com/u/hubix)
#### Post date: [22. Januar 2016 um 15:32 UTC](https://forum.shopware.com/t/plugin-erstellung-less-lasst-sich-nicht-laden/33831/2 "2016-01-22T15:32:26Z")

</div>

Ich weiss, wo mein Fehler lag. Ich hatte das passende subscribeEvent nicht in der install Function aufgerufen…
