# Plugin template nicht geladen

**URL:** <https://forum.shopware.com/t/plugin-template-nicht-geladen/53399>\
**Category:** Plugins\
**Created:** [11. Juni 2018 um 10:46 UTC](https://forum.shopware.com/t/plugin-template-nicht-geladen/53399 "2018-06-11T10:46:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MHotait](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@MHotait](https://forum.shopware.com/u/MHotait)\
**Post date:** [11. Juni 2018 um 10:46 UTC](https://forum.shopware.com/t/plugin-template-nicht-geladen/53399/1 "2018-06-11T10:46:14Z")

</div>

hallo,

ich probiere jetzt mein erstes plugin einzubauen. Ich habe aber ein Fehler so das die template ist nicht angezeigt obwohl habe ich der template ordner mit die Funktion addTemplateDir wie unten geschrieben.

&nbsp;

MohtGeschenkVerpackung.php

```
scheduleClearCache($this->getCacheArray());
        parent::install($context);
 
    }
 
    public function uninstall(UninstallContext $context)
    {
        $context->scheduleClearCache($this->getCacheArray());
        parent::uninstall($context);
    }
 
    public function activate(ActivateContext $context)
    {
        $context->scheduleClearCache($this->getCacheArray());
        parent::install($context);
    }
 
    public function deactivate(DeactivateContext $context)
    {
        $context->scheduleClearCache($this->getCacheArray());
        parent::install($context);
    }
 
 
    /**
     * Get caches to clear
     *
     * @return array
     */
    private function getCacheArray()
    {
        return [
            InstallContext::CACHE_TAG_CONFIG,
            InstallContext::CACHE_TAG_HTTP
        ];
    }
}

```

Subscriber/TemplateRegistration.php

```
pluginDirectory = $pluginDirectory;
        $this->templateManager = $templateManager;
    }

    /**
     * {@inheritdoc}
     */
    public static function getSubscribedEvents()
    {
        return [
            'Enlight_Controller_Action_PreDispatch' => 'onPreDispatch'
        ];
    }

    public function onPreDispatch()
    {
        $this->templateManager->addTemplateDir($this->pluginDirectory . '/Resources/views');
    }
}

```

und Resources/service.xml

```
            %moht_geschenk_verpackung.plugin_dir%

```

die template habe ich unter Resources/views/checkout/cart\_footer.tpl

```
{extends file="parent:frontend/checkout/cart_footer.tpl"}

{* Add product using the sku *}
{block name='frontend_checkout_cart_footer_add_product'}
    aaaaaaaaa
{/block}

{block name='frontend_checkout_cart_footer_element'}
    vvvvv
{/block}

```

was fählt mir noch ?&nbsp;

Danke&nbsp;

---

<div class="post-metadata">

**Author:** ![MHotait](https://avatars.discourse-cdn.com/v4/letter/m/e480ec/32.png) [@MHotait](https://forum.shopware.com/u/MHotait)\
**Post date:** [11. Juni 2018 um 11:50 UTC](https://forum.shopware.com/t/plugin-template-nicht-geladen/53399/2 "2018-06-11T11:50:26Z")

</div>

ich habe auch eine eigene theme, spielt das eine Role oder nicht ?
