# Template erweitern Unknow Path

**URL:** https://forum.shopware.com/t/template-erweitern-unknow-path/51731
**Category:** Programmierung
**Created:** [13. März 2018 um 13:34 UTC](https://forum.shopware.com/t/template-erweitern-unknow-path/51731 "2018-03-13T13:34:25Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Fensterscheibe](https://avatars.discourse-cdn.com/v4/letter/f/f4b2a3/32.png) [@Fensterscheibe](https://forum.shopware.com/u/Fensterscheibe)
#### Post date: [13. März 2018 um 13:34 UTC](https://forum.shopware.com/t/template-erweitern-unknow-path/51731/1 "2018-03-13T13:34:25Z")

</div>

```
 Hallo,

```

ich habe die in der Datei custom\plugins\fmFaq\Resources\views\frontend\faq\index.tpl folgenden Inhalt:

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

```

und ich erhalte folgende Fehlermeldung:

```
Fatal error: Uncaught SmartyException: Unknown path \C:\ShopwareBitnami\apps\shopware\htdocs\themes\Frontend\Responsive\\C:\ShopwareBitnami\apps\shopware\htdocs\themes\Frontend\Bare\\C:\ShopwareBitnami\apps\shopware\htdocs\custom\plugins\fmFaq\Controllers\Frontend/../../Resources/views\\C:\ShopwareBitnami\apps\shopware\htdocs\engine/Shopware/Plugins\Default\Core\PaymentMethods\Views/responsive\frontend/index/index.tpl in file frontend/index/index.tpl in C:\ShopwareBitnami\apps\shopware\htdocs\engine\Library\Smarty\sysplugins\smarty_resource.php:462 Stack trace: #0 C:\ShopwareBitnami\apps\shopware\htdocs\engine\Library\Enlight\Template\Plugins\resource.parent.php(55): Smarty_Resource->buildFilepath(Object(Smarty_Template_Source), Object(Enlight_Template_Default)) #1 C:\ShopwareBitnami\apps\shopware\htdocs\engine\Library\Enlight\Template\Plugins\resource.parent.php(79): Smarty_Resource_Parent->buildFilepath(Object(Smarty_Template_Source), Object(Enlight_Template_Default)) #2 C:\ShopwareBitnami\apps\shopware\htdocs\engine\Li in C:\ShopwareBitnami\apps\shopware\htdocs\engine\Library\Smarty\sysplugins\smarty_resource.php on line 462

```

&nbsp;

---

<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: [14. März 2018 um 07:24 UTC](https://forum.shopware.com/t/template-erweitern-unknow-path/51731/2 "2018-03-14T07:24:11Z")

</div>

Hallo @Fensterscheibe‍,

welche Version nutzt du denn?  
Darüber hinaus taucht in deinem Stacktrace ein Plugin mit Namen&nbsp; **fmFaq** &nbsp;auf - hast du mal versucht dieses zu deaktivieren?

Gruß,  
Patrick&nbsp; ![Shopware](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/86c57fbace799dd4eb1f1b8a2d3bdc1733f0aea1.png "Shopware")

---

<div class="post-metadata">

### Author: ![Fensterscheibe](https://avatars.discourse-cdn.com/v4/letter/f/f4b2a3/32.png) [@Fensterscheibe](https://forum.shopware.com/u/Fensterscheibe)
#### Post date: [14. März 2018 um 08:39 UTC](https://forum.shopware.com/t/template-erweitern-unknow-path/51731/3 "2018-03-14T08:39:25Z")

</div>

Shopware 5.4.1 über Bitnami Stack.

fmFaq ist mein Plugin, welches ich versuche zu entwickeln. Ich habe es schon mehrfach neu installiert.

---

<div class="post-metadata">

### Author: ![Rednaxela](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@Rednaxela](https://forum.shopware.com/u/Rednaxela)
#### Post date: [14. März 2018 um 08:49 UTC](https://forum.shopware.com/t/template-erweitern-unknow-path/51731/4 "2018-03-14T08:49:50Z")

</div>

Vielleicht liegt es einfach daran, dass du auf einem Windows System entwickelts. Kommt die Fehlermeldung auch auf nem Linux Server?

---

<div class="post-metadata">

### Author: ![Fensterscheibe](https://avatars.discourse-cdn.com/v4/letter/f/f4b2a3/32.png) [@Fensterscheibe](https://forum.shopware.com/u/Fensterscheibe)
#### Post date: [14. März 2018 um 09:50 UTC](https://forum.shopware.com/t/template-erweitern-unknow-path/51731/5 "2018-03-14T09:50:07Z")

</div>

> [@Rednaxela schrieb:](https://forum.shopware.com/profile/6813/Rednaxela "Rednaxela")
> 
> Vielleicht liegt es einfach daran, dass du auf einem Windows System entwickelts. Kommt die Fehlermeldung auch auf nem Linux Server?

&nbsp;Liegt am Windows System. Ich muss mir dann mal die virtuelle Maschine zum entwickeln herunterladen. Danke dir.

---

<div class="post-metadata">

### Author: ![WernerBu](https://avatars.discourse-cdn.com/v4/letter/w/71c47a/32.png) [@WernerBu](https://forum.shopware.com/u/WernerBu)
#### Post date: [28. März 2018 um 12:45 UTC](https://forum.shopware.com/t/template-erweitern-unknow-path/51731/6 "2018-03-28T12:45:34Z")

</div>

Das Verhalten bzw. der Fehler hat sich in der neuesten bitnami Version 5.4.1 für Windows nicht verändert, trotz der vielen Änderungen

bzgl. Pfaden für Windows in der Version 5.4.1. Templates können im Plugin somit nicht verwendet werden, wenn man eines erweitern will.

Neue Templates, die kein Template vom Bare-Theme erweitern, funktionieren aber.

---

<div class="post-metadata">

### Author: ![WernerBu](https://avatars.discourse-cdn.com/v4/letter/w/71c47a/32.png) [@WernerBu](https://forum.shopware.com/u/WernerBu)
#### Post date: [3. April 2018 um 08:42 UTC](https://forum.shopware.com/t/template-erweitern-unknow-path/51731/7 "2018-04-03T08:42:03Z")

</div>

Das Problem scheint die Datei smarty\_resource.php zu sein, hier insbesondere in der Methode buildFilepath die Stelle

```
**foreach** (explode('///', $validPaths) **as** $path) {...

```

Die funktioniert auf Windows mit bitnami-Installation nicht. Setzt man hier einfach

```
 $pathIsValid = true

```

findet er das eigene Template-File.

Hier scheint noch einiges nötig zu sein, da an mehreren Stellen immer noch mit einem festen Directory Separator (eben den von Linux) programmiert wird.

Aber prinzipiell sollte ja möglich sein, daß das auf Windows auch funktioniert, das schaffe andere Programme ja auch.

---

<div class="post-metadata">

### Author: ![Fl0](https://avatars.discourse-cdn.com/v4/letter/f/a9adbd/32.png) [@Fl0](https://forum.shopware.com/u/Fl0)
#### Post date: [4. Mai 2018 um 14:24 UTC](https://forum.shopware.com/t/template-erweitern-unknow-path/51731/8 "2018-05-04T14:24:21Z")

</div>

Um es auch für Windows lauffähig zu bekommen muss in der smarty\_resource.php folgendes geändert werden: (Aktuell Zeile 450)

**Vorher** :

```
$validPaths = substr($source->unique_resource, strpos($source->unique_resource, '#') + 1);
$validPaths = substr($validPaths, 0, strrpos($validPaths, '#'));

foreach (explode('///', $validPaths) as $path) {
    $fullPath = sprintf('%s%s%s%s', DS, trim($path, DS), DS, $file);
    if (file_exists($fullPath)) {
        $pathIsValid = true;
        break;
    }
}

```

**Nachher** :

```
$validPaths = substr($source->unique_resource, strpos($source->unique_resource, '#') + 1);
$validPaths = substr($validPaths, 0, strrpos($validPaths, '#'));

$delimiter = DS . DS . DS;
$prefix = DS;

// if server is running windows
if(DS == '\\') {
    $delimiter = DS . DS;
    $prefix = '';
}

foreach (explode($delimiter, $validPaths) as $path) {
    $fullPath = sprintf('%s%s%s%s', $prefix, trim($path, DS), DS, $file);
    if (file_exists($fullPath)) {
        $pathIsValid = true;
        break;
    }
}
```
