# .tpl funktioniert nach Update nicht mehr

**URL:** <https://forum.shopware.com/t/tpl-funktioniert-nach-update-nicht-mehr/50172>\
**Category:** Themes & Design\
**Created:** [28. Dezember 2017 um 08:25 UTC](https://forum.shopware.com/t/tpl-funktioniert-nach-update-nicht-mehr/50172 "2017-12-28T08:25:34Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saugertyp](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Saugertyp](https://forum.shopware.com/u/Saugertyp)\
**Post date:** [28. Dezember 2017 um 08:25 UTC](https://forum.shopware.com/t/tpl-funktioniert-nach-update-nicht-mehr/50172/1 "2017-12-28T08:25:34Z")

</div>

Hallo,  
ich hatte um Unterkategorien farblich abzugrenzen folgenden Code in Verwendung:

```
{* Maincategories left *}
{function name=categories level=0}
    
    {block name="frontend_index_categories_left_entry"}{/block}
    {foreach from=$categories item=category}

         {if $level > 0}

                {$category.description}
            
          {/if}
            {if $category.subcategories}
                 {call name=categories categories=$category.subcategories level=$level+1}
      {/if}
        
    {/foreach}
{block name="frontend_index_categories_left_after"}{/block}
     
{/function}
{if $sCategories}
    {call name=categories categories=$sCategories}
{elseif $sMainCategories} 
{call name=categories categories=$sMainCategories}{/if}

```

&nbsp;

Nach dem Update auf die aktuellste Versien bekomme ich allerdings folgende Fehlermeldung:

&nbsp;

exception ‚SmartyCompilerException‘ with message ‚Syntax Error in template „/MEINSHOP/httpdocs/themes/Frontend/Marken\_tools/frontend/index/sidebar-categories.tpl“&nbsp; on line 9 „\<a href=“{if $category.flag}has–sub-categories{/if}{if $category.external}{$category.external}{else}{$category.link|rewrite:$category.description}{/if}" class=" {if $level == 0}{/if} navigation–link {if $category.flag} is–active{/if}"\>" unknown modifier „rewrite“‘ in /engine/Library/Smarty/sysplugins/smarty\_internal\_templatecompilerbase.php:657 Stack trace:  
#0 /engine/Library/Smarty/sysplugins/smarty\_internal\_compile\_private\_modifier.php(132): Smarty\_Internal\_TemplateCompilerBase-\>trigger\_template\_error(‚unknown modifie…‘, 9)  
#1 /engine/Library/Smarty/sysplugins/smarty\_internal\_templatecompilerbase.php(475): Smarty\_Internal\_Compile\_Private\_Modifier-\>compile(Array, Object(Smarty\_Internal\_SmartyTemplateCompiler), Array, NULL, NULL)  
#2 /engine/Library/Smarty/sysplugins/smarty\_internal\_templatecompilerbase.php(249): Smarty\_Internal\_TemplateCompilerBase-\>callTagCompiler(‚private\_modifie…‘, Array, Array)  
#3 /engine/Library/Smarty/sysplugins/smarty\_internal\_compile\_private\_print\_expression.php(65): Smarty\_Internal\_TemplateCompilerBase-\>compileTag(‚private\_modifie…‘, Array, Array)  
#4 /engine/Library/Smarty/sysplugins/smarty\_internal\_templatecompilerbase.php(465): Smarty\_Internal\_Compile\_Private\_Print\_Expression-\>compile(Array, Object(Smarty\_Internal\_SmartyTemplateCompiler), Array, NULL, NULL)  
#5 /engine/Library/Smarty/sysplugins/smarty\_internal\_templatecompilerbase.php(249): Smarty\_Internal\_TemplateCompilerBase-\>callTagCompiler(‚private\_print\_e…‘, Array, Array)  
#6 /engine/Library/Smarty/sysplugins/smarty\_internal\_templateparser.php(2358): Smarty\_Internal\_TemplateCompilerBase-\>compileTag(‚private\_print\_e…‘, Array, Array)  
#7 /engine/Library/Smarty/sysplugins/smarty\_internal\_templateparser.php(3101): Smarty\_Internal\_Templateparser-\>yy\_r28()  
#8 /engine/Library/Smarty/sysplugins/smarty\_internal\_templateparser.php(3201): Smarty\_Internal\_Templateparser-\>yy\_reduce(28)  
#9 /engine/Library/Smarty/sysplugins/smarty\_internal\_smartytemplatecompiler.php(105): Smarty\_Internal\_Templateparser-\>doParse(34, ‚{/‘)  
#10 /engine/Library/Smarty/sysplugins/smarty\_internal\_templatecompilerbase.php(192): Smarty\_Internal\_SmartyTemplateCompiler-\>doCompile(’{\* Maincategori…’)  
#11 /engine/Library/Smarty/sysplugins/smarty\_internal\_compile\_include.php(146): Smarty\_Internal\_TemplateCompilerBase-\>compileTemplate(Object(Enlight\_Template\_Default))  
#12 /engine/Library/Smarty/sysplugins/smarty\_internal\_templatecompilerbase.php(465): Smarty\_Internal\_Compile\_Include-\>compile(Array, Object(Smarty\_Internal\_SmartyTemplateCompiler), Array, NULL, NULL)  
#13 /engine/Library/Smarty/sysplugins/smarty\_internal\_templatecompilerbase.php(249): Smarty\_Internal\_TemplateCompilerBase-\>callTagCompiler(‚include‘, Array, Array)  
#14 /engine/Library/Smarty/sysplugins/smarty\_internal\_templateparser.php(2388): Smarty\_Internal\_TemplateCompilerBase-\>compileTag(‚include‘, Array)  
#15 /engine/Library/Smarty/sysplugins/smarty\_internal\_templateparser.php(3101): Smarty\_Internal\_Templateparser-\>yy\_r36()  
#16 /engine/Library/Smarty/sysplugins/smarty\_internal\_templateparser.php(3201): Smarty\_Internal\_Templateparser-\>yy\_reduce(36)  
#17 /engine/Library/Smarty/sysplugins/smarty\_internal\_smartytemplatecompiler.php(105): Smarty\_Internal\_Templateparser-\>doParse(10, ‚\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; …‘)  
#18 /engine/Library/Smarty/sysplugins/smarty\_internal\_templatecompilerbase.php(192): Smarty\_Internal\_SmartyTemplateCompiler-\>doCompile(’{block name="fr…’)  
#19 /engine/Library/Smarty/sysplugins/smarty\_internal\_compile\_include.php(146): Smarty\_Internal\_TemplateCompilerBase-\>compileTemplate(Object(Enlight\_Template\_Default))  
#20 /engine/Library/Smarty/sysplugins/smarty\_internal\_templatecompilerbase.php(475): Smarty\_Internal\_Compile\_Include-\>compile(Array, Object(Smarty\_Internal\_SmartyTemplateCompiler), Array, NULL, NULL)  
#21 /engine/Library/Smarty/sysplugins/smarty\_internal\_templatecompilerbase.php(249): Smarty\_Internal\_TemplateCompilerBase-\>callTagCompiler(‚include‘, Array, Array)  
#22 /engine/Library/Smarty/sysplugins/smarty\_internal\_templateparser.php(2388): Smarty\_Internal\_TemplateCompilerBase-\>compileTag(‚include‘, Array)  
#23 /engine/Library/Smarty/sysplugins/smarty\_internal\_templateparser.php(3101): Smarty\_Internal\_Templateparser-\>yy\_r36()  
#24 /engine/Library/Smarty/sysplugins/smarty\_internal\_templateparser.php(3201): Smarty\_Internal\_Templateparser-\>yy\_reduce(36)  
#25 /engine/Library/Smarty/sysplugins/smarty\_internal\_smartytemplatecompiler.php(105): Smarty\_Internal\_Templateparser-\>doParse(10, ‚\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; …‘)  
#26 /engine/Library/Smarty/sysplugins/smarty\_internal\_templatecompilerbase.php(192): Smarty\_Internal\_SmartyTemplateCompiler-\>doCompile(’{block name="fr…’)  
#27 /engine/Library/Smarty/sysplugins/smarty\_internal\_template.php(187): Smarty\_Internal\_TemplateCompilerBase-\>compileTemplate(Object(Enlight\_Template\_Default))  
#28 /engine/Library/Smarty/sysplugins/smarty\_internal\_templatebase.php(155): Smarty\_Internal\_Template-\>compileTemplateSource()  
#29 /engine/Library/Enlight/View/Default.php(276): Smarty\_Internal\_TemplateBase-\>fetch()  
#30 /engine/Library/Enlight/Controller/Plugins/ViewRenderer/Bootstrap.php(216): Enlight\_View\_Default-\>render(Object(Enlight\_Template\_Default))  
#31 /engine/Library/Enlight/Controller/Plugins/ViewRenderer/Bootstrap.php(242): Enlight\_Controller\_Plugins\_ViewRenderer\_Bootstrap-\>renderTemplate(Object(Enlight\_Template\_Default))  
#32 /engine/Library/Enlight/Controller/Plugins/ViewRenderer/Bootstrap.php(136): Enlight\_Controller\_Plugins\_ViewRenderer\_Bootstrap-\>render()  
#33

&nbsp;

Weis jemand, worann das liegen könnte?

Mit freundlichen Grüßen  
Saugertyp

---

<div class="post-metadata">

**Author:** ![waldicom](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/waldicom/32/12881_2.png) [@waldicom](https://forum.shopware.com/u/waldicom)\
**Post date:** [28. Dezember 2017 um 08:31 UTC](https://forum.shopware.com/t/tpl-funktioniert-nach-update-nicht-mehr/50172/2 "2017-12-28T08:31:45Z")

</div>

Das liegt an dem “|rewrite” modifier. In Shopware 5.3 wird das nicht mehr verwendet. Statdessen müsste es direkt mit {$category.link} funktionieren.

---

<div class="post-metadata">

**Author:** ![Saugertyp](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Saugertyp](https://forum.shopware.com/u/Saugertyp)\
**Post date:** [28. Dezember 2017 um 08:43 UTC](https://forum.shopware.com/t/tpl-funktioniert-nach-update-nicht-mehr/50172/3 "2017-12-28T08:43:46Z")

</div>

Danke schonmal.

Wie müsste das dann aussehen?

---

<div class="post-metadata">

**Author:** ![waldicom](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/waldicom/32/12881_2.png) [@waldicom](https://forum.shopware.com/u/waldicom)\
**Post date:** [28. Dezember 2017 um 08:46 UTC](https://forum.shopware.com/t/tpl-funktioniert-nach-update-nicht-mehr/50172/4 "2017-12-28T08:46:15Z")

</div>

Statt “{$category.link|rewrite:$category.description}” bitte folgendes probieren:&nbsp;{$category.link}

---

<div class="post-metadata">

**Author:** ![Saugertyp](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Saugertyp](https://forum.shopware.com/u/Saugertyp)\
**Post date:** [28. Dezember 2017 um 08:50 UTC](https://forum.shopware.com/t/tpl-funktioniert-nach-update-nicht-mehr/50172/5 "2017-12-28T08:50:23Z")

</div>

Vielen Dank!  
So funktioniert es wieder.

Kann man das noch so weit einschränken, dass das nur auf dem Pc greift?  
So wie bei .less?

---

<div class="post-metadata">

**Author:** ![waldicom](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/waldicom/32/12881_2.png) [@waldicom](https://forum.shopware.com/u/waldicom)\
**Post date:** [28. Dezember 2017 um 08:51 UTC](https://forum.shopware.com/t/tpl-funktioniert-nach-update-nicht-mehr/50172/6 "2017-12-28T08:51:58Z")

</div>

> [@Saugertyp schrieb:](https://forum.shopware.com/profile/25791/Saugertyp "Saugertyp")
> 
> Kann man das noch so weit einschränken, dass das nur auf dem Pc greift?  
> So wie bei .less?

Bin mir leider nicht sicher, was Du meinst. Aber dieses „rewrite“ funktioniert auf keinem PC, wenn Shopware 5.3 installiert ist. Oder war das anders gemeint?&nbsp;

---

<div class="post-metadata">

**Author:** ![Saugertyp](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Saugertyp](https://forum.shopware.com/u/Saugertyp)\
**Post date:** [28. Dezember 2017 um 09:03 UTC](https://forum.shopware.com/t/tpl-funktioniert-nach-update-nicht-mehr/50172/7 "2017-12-28T09:03:13Z")

</div>

Jap, war anders gemeint.  
Durch die tpl sind die Kategorien auf dem Handy nicht mehr klickbar, hätte gerne, dass sie nur für Pc greift, nicht für Handy.

---

<div class="post-metadata">

**Author:** ![Saugertyp](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Saugertyp](https://forum.shopware.com/u/Saugertyp)\
**Post date:** [2. Januar 2018 um 10:13 UTC](https://forum.shopware.com/t/tpl-funktioniert-nach-update-nicht-mehr/50172/8 "2018-01-02T10:13:41Z")

</div>

\*Push\*

Immernoch keine Lösung gefunden.

---

<div class="post-metadata">

**Author:** ![simkli](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/simkli/32/13124_2.png) [@simkli](https://forum.shopware.com/u/simkli)\
**Post date:** [2. Januar 2018 um 21:05 UTC](https://forum.shopware.com/t/tpl-funktioniert-nach-update-nicht-mehr/50172/9 "2018-01-02T21:05:29Z")

</div>

> Durch die tpl sind die Kategorien auf dem Handy nicht mehr klickbar, hätte gerne, dass sie nur für Pc greift, nicht für Handy.

Was genau soll nur auf dem PC greifen?

Du kannst den Block doch via LESS am Handy ausblenden und dann am Desktop anzeigen. Wo genau liegt das Problem. Beschreibe es doch bitte etwas ausführlicher.

Viele Grüße&nbsp;
