Need help understanding Menu Manager syntax
Posted: Thu Mar 26, 2009 2:17 am
Hello all,
I am trying to create a custom (semi-custom?) horizontal CSS/image menu, as described here:
http://wiki.cmsmadesimple.org/index.php ... nu_Styling
I'm running into several issues, and I think the biggest one is that I don't understand the menu template syntax. I have read and reread the author's comments, the Menu Manager help, and have searched the forum, but can't seem to get my head around a couple of things. For example, here is the code that the author says should be placed into the menu template:
What does this line do:
I can tell that it replaces the menu text with the CSS class, but why does it have two "replace" commands? Is it a "first and last" thing? So if my first page were "Main" and my last page were "Donations", I would rewrite the line as:
??
Also, what is the significance of this line:
Do I need to change the node id to match the id of my actual page, or is there something magical about a node id of 15 that somehow makes everything work right?
I'll probably have more questions, but if someone can get me pointed in the right direction, I think I can make progress. Thanks in advance!!
I am trying to create a custom (semi-custom?) horizontal CSS/image menu, as described here:
http://wiki.cmsmadesimple.org/index.php ... nu_Styling
I'm running into several issues, and I think the biggest one is that I don't understand the menu template syntax. I have read and reread the author's comments, the Menu Manager help, and have searched the forum, but can't seem to get my head around a couple of things. For example, here is the code that the author says should be placed into the menu template:
Code: Select all
{if $count > 0}
{foreach from=$nodelist item=node}
{if $node->current == true}
<div class="{$node->menutext|replace:'Home':'home2'|replace:'Contact':'contact2'} nav">
<a href="{if $node->id == 15}/{else}{$node->url}{/if}"{if $node->target ne ""} target="{$node->target}"{/if}></a></div>
{elseif $node->parent == true}
<div class="{$node->menutext|replace:'Home':'home2'|replace:'Contact':'contact2'} nav">
<a href="{if $node->id == 15}/{else}{$node->url}{/if}"{if $node->target ne ""} target="{$node->target}"{/if}></a></div>
{else}
<div class="{$node->menutext|replace:'Home':'home'|replace:'Contact':'contact'} nav">
<a href="{if $node->id == 15}/{else}{$node->url}{/if}"{if $node->target ne ""} target="{$node->target}"{/if}></a></div>
{/if}
{/foreach}
{/if}
Code: Select all
{$node->menutext|replace:'Home':'home2'|replace:'Contact':'contact2'}
Code: Select all
{$node->menutext|replace:'Main':'main2'|replace:'Donations':'donations2'}
Also, what is the significance of this line:
Code: Select all
{if $node->id == 15}
I'll probably have more questions, but if someone can get me pointed in the right direction, I think I can make progress. Thanks in advance!!