# Template-Vererbung

**URL:** https://forum.shopware.com/t/template-vererbung/3904
**Category:** Shopware 3.5
**Tags:** templates--design
**Created:** [12. August 2011 um 09:27 UTC](https://forum.shopware.com/t/template-vererbung/3904 "2011-08-12T09:27:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![avenger](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@avenger](https://forum.shopware.com/u/avenger)
#### Post date: [12. August 2011 um 09:27 UTC](https://forum.shopware.com/t/template-vererbung/3904/1 "2011-08-12T09:27:44Z")

</div>

Habe da noch ein Verständnisfrage: Wenn ich in meinem Template-Bereich eine “template/frontend/index/index.tpl” folgenden Inhalts anlege [quote] {extends file=“frontend/index/index.tpl”} {block name=‘frontend\_index\_navigation’ prepend} ![]() ![](){/block} [/quote] Ergibt das folgende Fehlermeldung: [quote] Fatal error: Uncaught exception ‘SmartyCompilerException’ with message ‘Syntax Error in template “H:\Apache Group\Apache\htdocs\seifenparadies\shopware\_powertemplate\shopware\templates/modebina/frontend/index/index.tpl” on line 2 "{extends file=“frontend/index/index.tpl”} " illegal recursive call of “frontend/index/index.tpl”’ in H:\Apache Group\Apache\htdocs\seifenparadies\shopware\_powertemplate\shopware\engine\Enlight\Vendor\Smarty\libs\sysplugins\smarty\_internal\_templatecompilerbase.php:404 Stack trace: #0 H:\Apache Group\Apache\htdocs\seifenparadies\shopware\_powertemplate\shopware\engine\Enlight\Vendor\Smarty\libs\sysplugins\smarty\_internal\_compile\_extends.php(45): Smarty\_Internal\_TemplateCompilerBase-\>trigger\_template\_error(‘illegal recursi…’, 2) #1 H:\Apache Group\Apache\htdocs\seifenparadies\shopware\_powertemplate\shopware\engine\Enlight\Vendor\Smarty\libs\sysplugins\smarty\_internal\_templatecompilerbase.php(252): Smarty\_Internal\_Compile\_Extends-\>compile(Array, Object(Smarty\_In [/quote] (Wobei zu sagen ist, dass ich eine “\_local/frontend/index/index.tpl” gibt…) Wenn ich die “template/frontend/index/index.tpl” so gestalte, funktioniert das… [quote] {extends file="…/\_local/frontend/index/index.tpl"} {block name=‘frontend\_index\_navigation’ prepend} ![]() ![](){/block} [/quote] Bedeutet das, dass man keine mehrstufige Vererbung realisieren kann (template/frontend/index/index.tpl =\> \_local/frontend/index/index.tpl =\> \_default/frontend/index/index.tpl)?

---

<div class="post-metadata">

### Author: ![radox1](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@radox1](https://forum.shopware.com/u/radox1)
#### Post date: [12. August 2011 um 11:13 UTC](https://forum.shopware.com/t/template-vererbung/3904/2 "2011-08-12T11:13:18Z")

</div>

Wenn ich ein Template erweitern will nehm ich: {extends file="…/\_default/frontend/index/index.tpl"} Bei deinem ersten Beispiel: {extends file=„frontend/index/index.tpl“} versucht das Template sich quasi selbst zu erweitern - deswegen der Fehler mit dem rekursiven Aufruf - denke ich zumindest.

---

<div class="post-metadata">

### Author: ![avenger](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@avenger](https://forum.shopware.com/u/avenger)
#### Post date: [12. August 2011 um 11:18 UTC](https://forum.shopware.com/t/template-vererbung/3904/3 "2011-08-12T11:18:40Z")

</div>

[quote=“radox”]Bei deinem ersten Beispiel: {extends file=“frontend/index/index.tpl”} versucht das Template sich quasi selbst zu erweitern - deswegen der Fehler mit dem rekursiven Aufruf - denke ich zumindest.[/quote] Wird wohl der Grund sein…
