How to add specified css class for every page in menu?
Posted: Sat Jan 23, 2010 11:44 am
Hello,
do you know, please, how is possible to have every page specific CSS classs?
For example structure of the pages could be:
1. úvod
2. text
3. závěr
what represents HTML code:
...and I need something similar...
I tried to use class="{$node.alias}", but id doesnt work. When I put into the menu template:
The CMS write this error:
I use last CMS MS 1.6.6 ib Czech language, on Apache server (Linux 2.6.18-6-amd64 Zap x86_64), Php 5.2.12, MySQL 5.0.32 .
do you know, please, how is possible to have every page specific CSS classs?
For example structure of the pages could be:
1. úvod
2. text
3. závěr
what represents HTML code:
Code: Select all
<ul>
<li><a href="#">úvod</a></li>
<li><a href="#">text</a></li>
<li><a href="#">závěr</a></li>
</ul>
Code: Select all
<ul>
<li class="uvod"><a href="#">úvod</a></li>
<li class="text"><a href="#">text</a></li>
<li class="zaver"><a href="#">závěr</a></li>
</ul>
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}
Can anybody helps me? Have I some bug in my template? Or the method is wrong? How shold I put specified css class in the menu?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
I use last CMS MS 1.6.6 ib Czech language, on Apache server (Linux 2.6.18-6-amd64 Zap x86_64), Php 5.2.12, MySQL 5.0.32 .