# Backend Template greift immer nur auf \_default zu

**URL:** <https://forum.shopware.com/t/backend-template-greift-immer-nur-auf-default-zu/19071>\
**Category:** Shopware 3.5\
**Tags:** themes--design\
**Created:** [14. März 2014 um 13:25 UTC](https://forum.shopware.com/t/backend-template-greift-immer-nur-auf-default-zu/19071 "2014-03-14T13:25:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![justink](https://avatars.discourse-cdn.com/v4/letter/j/e79b87/32.png) [@justink](https://forum.shopware.com/u/justink)\
**Post date:** [14. März 2014 um 13:25 UTC](https://forum.shopware.com/t/backend-template-greift-immer-nur-auf-default-zu/19071/1 "2014-03-14T13:25:11Z")

</div>

Hallo, wir erstellen momentan für einen Kunden ein eigenes Template. Das klappt hinsichtlich der Vererbung Template-\>\_emotion-\>\_default auch ganz gut im Frontend. Jetzt muss eine Änderung im Backend vorgenommen werden - genauer gesagt momentan nur in der backend/category/controller/tree.js. In dieser existiert auch ein block, was mich überraschte, da die jquery.shopware.js des Frontends dieses nicht besaß - wir mussten sie komplett übernehmen für Änderungen (Nebenbei: Warum ist das so?). Jedoch griff Shopware nach der Erstellung der tree.js im richtigen Ordner immernoch auf die Datei im \_default Template zu. Selbst wenn ich den kompletten backend Ordner kopiere nutzt es dennoch die \_default. Cache habe ich bereits geleert. Ist diese Funktionalität überhaupt gegeben oder muss man hier Änderungen in der \_default vornehmen? Wäre ja eigentlich Unsinn wenn man bereits ein solches System nutzt. Wie ich gesehen habe bin ich hier nicht der einzige: [templates-und-design-f57/eigenes-backend-template-t15966.html](http://forum.shopware.de/templates-und-design-f57/eigenes-backend-template-t15966.html) Dieser Thread bezieht sich wohl auf ein ähnliches Problem, bekam jedoch keine Antwort. Grüße

---

<div class="post-metadata">

**Author:** ![EikeBrandtWarneke](https://avatars.discourse-cdn.com/v4/letter/e/cdc98d/32.png) [@EikeBrandtWarneke](https://forum.shopware.com/u/EikeBrandtWarneke)\
**Post date:** [14. März 2014 um 13:36 UTC](https://forum.shopware.com/t/backend-template-greift-immer-nur-auf-default-zu/19071/2 "2014-03-14T13:36:41Z")

</div>

Die Vererbung von Shopware Templates greift tatsächlich (leider!) nicht für den backend Bereich. Um die tree.js zu erweitern musst du ein entsprechendes Plugin schreiben. Viele Grüße

---

<div class="post-metadata">

**Author:** ![justink](https://avatars.discourse-cdn.com/v4/letter/j/e79b87/32.png) [@justink](https://forum.shopware.com/u/justink)\
**Post date:** [17. März 2014 um 14:52 UTC](https://forum.shopware.com/t/backend-template-greift-immer-nur-auf-default-zu/19071/3 "2014-03-17T14:52:26Z")

</div>

Habe eben Versucht die tree.js via Backend-Plugin zu überschreiben: ![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/2X/e/e7bfdd4e524f24baeb493523898141cb2379c8d1.png) Das ist meine Bootstrap.php: [code]\<?php /\*\*

- Shopware 4.0
- Copyright © 2012 shopware AG
- 
- According to our dual licensing model, this program can be used either
- under the terms of the GNU Affero General Public License, version 3,
- or under a proprietary license.
- 
- The texts of the GNU Affero General Public License with an additional
- permission and of our proprietary license can be found at and
- in the LICENSE file you have received along with this program.
- 
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
- 
- „Shopware“ is a registered trademark of shopware AG.
- The licensing of the program under the AGPLv3 does not imply a
- trademark license. Therefore any rights, title and interest in
- our trademarks remain entirely with us.  
\*/

class Shopware\_Plugins\_Backend\_PluginBackend\_Bootstrap extends Shopware\_Components\_Plugin\_Bootstrap  
{  
/\*\*  
\* Returns the current version of the plugin.  
\* @return string  
\*/  
public function getVersion()  
{  
return ‚0.5.0‘;  
}

```
/**
 * Get (nice) name for plugin manager list
 * @return string
 */
public function getLabel()
{
    return 'Backend Erweiterung';
}

/**
 * Returns the meta information about the plugin.
 *
 * @return array
 */
public function getInfo()
{
    return array(
        'version' => $this-\>getVersion(), 'label' =\> $this-\>getLabel() ); } /\*\* \* @return bool \*/ public function update($version) { return true; } /\*\* \* Standard plugin install method to register all required components. \* @throws \Exception \* @return bool success \*/ public function install() { try { $this-\>subscribeEvents(); } catch (Exception $e) { return array( 'success' =\> false, 'message' =\> "Well" ); } return true; } /\*\* \* @param Enlight\_Event\_EventArgs $args \*/ private function addDirs(Enlight\_Event\_EventArgs $args) { $args-\>getSubject()-\>View()-\>addTemplateDir( $this-\>Path() . 'Views/' ); } /\*\* \* Registers all necessary events and hooks. \*/ private function subscribeEvents() { $this-\>subscribeEvent( 'Enlight\_Controller\_Action\_PostDispatch\_Backend\_Category', 'onBackendCategoryPostDispatch' ); } /\*\* \* On uninstall \* @return bool \*/ public function uninstall() { return true; } /\*\* \* Called when the BackendCategoryPostDispatch Event is triggered \* \* @param Enlight\_Event\_EventArgs $args \*/ public function onBackendCategoryPostDispatch(Enlight\_Event\_EventArgs $args) { $view = $args-\>getSubject()-\>View(); $this-\>addDirs($args); if($args-\>getRequest()-\>getActionName() === 'load') { $view-\>extendsTemplate( 'backend/category/controller/tree.js' ); } } }[/code] Anschließend meine tree.js: [code]//{block name="backend/category/controller/tree"} alert("Uses Plugin!"); Ext.define('Shopware.apps.Category.controller.Tree', { // New JS Code }); //{/block} [/code] Dennoch wird nach Installtion und Aktivierung des Plugins immer noch die \_default tree.js aufgerufen...
```
