# Unable to load template extends

**URL:** <https://forum.shopware.com/t/unable-to-load-template-extends/7547>\
**Category:** Shopware 3.5\
**Tags:** programming\
**Created:** [27. Juni 2012 um 18:07 UTC](https://forum.shopware.com/t/unable-to-load-template-extends/7547 "2012-06-27T18:07:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ottscho](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@ottscho](https://forum.shopware.com/u/ottscho)\
**Post date:** [27. Juni 2012 um 18:07 UTC](https://forum.shopware.com/t/unable-to-load-template-extends/7547/1 "2012-06-27T18:07:17Z")

</div>

Hallo, warum wird hier das Template unter frontend/ott\_notification/ajax\_notification.tpl gesucht? [code]\<?php class Shopware\_Controllers\_Frontend\_OttNotification extends Enlight\_Controller\_Action  
{

```
	public function indexAction()
		{	
			$ordernumber = $this->Request()-\>getParam('sAdd'); $articleID = Shopware()-\>Modules()-\>Articles()-\>sGetArticleIdByOrderNumber($ordernumber); $this-\>View()-\>articleNotificationID = $articleID; $this-\>View()-\>ordernumberNotification = $ordernumber; $this-\>forward('ajax\_notification'); } public function ajaxNotificationAction() { Enlight()-\>Plugins()-\>Controller()-\>Json()-\>setPadding(); } } ?\> [/code] Fehler: exception 'SmartyException' with message 'Unable to load template extends 'frontend/ott\_notification/ajax\_notification.tpl Das Template, welches ich laden möchte liegt eig. unter: engine/Shopware/Plugins/Community/Frontend/OttNotification/View/templates/ajax\_notification.tpl Von hier wird es aber nicht erwartet. Wie bekomme ich das hin?
```

---

<div class="post-metadata">

**Author:** ![ottscho](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@ottscho](https://forum.shopware.com/u/ottscho)\
**Post date:** [27. Juni 2012 um 21:33 UTC](https://forum.shopware.com/t/unable-to-load-template-extends/7547/2 "2012-06-27T21:33:43Z")

</div>

Niemand eine Idee?

---

<div class="post-metadata">

**Author:** ![Patrick\_Stahl](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/patrick_stahl/32/7679_2.png) [@Patrick\_Stahl](https://forum.shopware.com/u/Patrick_Stahl)\
**Post date:** [28. Juni 2012 um 17:57 UTC](https://forum.shopware.com/t/unable-to-load-template-extends/7547/3 "2012-06-28T17:57:31Z")

</div>

Hallo, du könntest versuchen in der Index-Action ein Default-Template-Verzeichnis zu hinterlegen, also so: `$this-\>View()-\>addTemplateDir(dirname(\_\_FILE\_\_) . '/Views/templates/')` Dann müsste er die Datei unter deinPlugin/Views/templates suchen. Ich bin mir ehrlich gesagt spontan aber auch nicht sicher, ob er die Funktion im Controller hat. Gruß, Patrick :shopware:

---

<div class="post-metadata">

**Author:** ![ottscho](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@ottscho](https://forum.shopware.com/u/ottscho)\
**Post date:** [29. Juni 2012 um 10:31 UTC](https://forum.shopware.com/t/unable-to-load-template-extends/7547/4 "2012-06-29T10:31:38Z")

</div>

Hi Patrick, danke für den Tipp. Leider aber erfolglos. Der Fehler bleibt erhalten: Unable to load template extends frontend/ott\_notification/ajax\_notification.tpl Hast du noch eine Idee? Es wäre schon schön, wenn die Templatedatei im Plugin Ordner liegen könnte.

---

<div class="post-metadata">

**Author:** ![Patrick\_Stahl](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/patrick_stahl/32/7679_2.png) [@Patrick\_Stahl](https://forum.shopware.com/u/Patrick_Stahl)\
**Post date:** [29. Juni 2012 um 17:14 UTC](https://forum.shopware.com/t/unable-to-load-template-extends/7547/5 "2012-06-29T17:14:37Z")

</div>

Hallo, zunächst würde ich eine init-Methode erstellen mit folgendem Inhalt: ` public function init8) { $this-\>View()-\>addTemplateDir(dirname(\_\_FILE\_\_).'/Views/templates/'); } ` Und dann in deiner AjaxNotification-Action folgende Zeile einfügen: `Shopware()-\>Plugins()-\>Controller()-\>ViewRenderer()-\>setNoRender();` Ich gehe einmal davon aus, dass es sich hier um ein Plugin handelt? In diesem Fall dürfte er nicht mehr versuchen überhaupt ein Template zu laden. Dann kannst du versuchen mit `$this-\>View()-\>loadTemplate("ajax\_notification.tpl")` Ansonsten kann ich mir das auch mal auf deinem System anschauen, wenn du magst. Gruß, Patrick :shopware:

---

<div class="post-metadata">

**Author:** ![ottscho](https://avatars.discourse-cdn.com/v4/letter/o/7ba0ec/32.png) [@ottscho](https://forum.shopware.com/u/ottscho)\
**Post date:** [29. Juni 2012 um 18:21 UTC](https://forum.shopware.com/t/unable-to-load-template-extends/7547/6 "2012-06-29T18:21:13Z")

</div>

Geht leider auch nicht. Jetzt kommt keine Fehlermeldung, aber es wird auch nicht geladen 😉 Ich schicke dir eine PN mit den Zugangsdaten. Danke schon mal im Voraus.
