Zdravím,
tak teď s tím zkouším pracovat, ale CMS mi hází chybu. Mám pro menu následující kód:
Code: Select all
{if $count > 0}
<ul>
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul>" times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}
{elseif $node->current == true}
<li class="{$node.alias}" id="active">{$node->menutext}
{else}
<li class="{$node.alias}"><a href="{$node->url}">{$node->menutext}</a>
{/if}
{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
Pokud tuhle šablonu, ale aktivuji, pak mi CMS vyhodí toto:
string(136) "Smarty error: [in module_db_tpl:MenuManager;navigation line 12]: syntax error: unexpected {elseif} (Smarty_Compiler.class.php, line 486)"
string(134) "Smarty error: [in module_db_tpl:MenuManager;navigation line 15]: syntax error: unexpected {else} (Smarty_Compiler.class.php, line 478)"
string(176) "Smarty error: [in module_db_tpl:MenuManager;navigation line 18]: syntax error: mismatched tag {/if}. expected {/foreach} (opened line 3). (Smarty_Compiler.class.php, line 2303)"
string(176) "Smarty error: [in module_db_tpl:MenuManager;navigation line 20]: syntax error: mismatched tag {/foreach}. expected {/if} (opened line 1). (Smarty_Compiler.class.php, line 2303)"
string(139) "Smarty error: [in module_db_tpl:MenuManager;navigation line 23]: syntax error: mismatched tag {/if}. (Smarty_Compiler.class.php, line 2303)"
Parse error: syntax error, unexpected T_ELSEIF in /data/www/beznudy.cz/test.beznudy.cz/tmp/templates_c/8e95733b1edd65963770a93603b5efcb^%%D4^D49^D49AE758%%module_db_tpl%3AMenuManager%3Bnavigation.php on line 20
Mám v šabloně menu chybu? Nevíte jak mi pomoci?