Page 1 of 1

[solved] Menu Manager

Posted: Wed Sep 05, 2007 2:19 am
by kcaldwell1123
I am in the process of importing a template.  I am having a bit of difficluty trying to figure out a menu.
The page is:  http://bogeybluesgolf.com/cms/index.php ... ic-options

On the left hand side there are to navigation menus.  The bottom one is hard coded in the content.  The top one is the one I am working on converting to using the Menu Manager.  I have it working sort of at this point, but it does not look right.  I need to set the class='group' on the tag, but I am not sure how to without effecting the Main Horizontal menu.  I am including the Menu Template.  I have only changed a couple of minor things from the simple_navigation.tpl template.

Code: Select all

{* CSS classes used in this template:
.activeparent - The top level parent when a child is the active/current page
li.active0n h3 - n is the depth/level of the node. To style the active page for each level separately. The active page is not clickable.
.clearfix - Used for the unclickable h3 to use the entire width of the li, just like the anchors. See the Tools stylesheet in the default CMSMS installation.
li.sectionheader h3 - To style section header
li.separator - To style the ruler for the separator *} 

{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}

{if $node->current == true}
<li class="selected"><dfn>Current page is {$node->hierarchy}: </dfn>{$node->menutext}

{elseif $node->parent == true}
{* <li class="activeparent"> *}
<li class="group"><a class="activeparent" href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}><dfn>{$node->hierarchy}: </dfn>{$node->menutext}</a>

{elseif $node->type == 'sectionheader'}
<li class="sectionheader">{$node->menutext}

{elseif $node->type == 'separator'}
<li class="separator" style="list-style-type: none;"> <hr />

{else}
<li><a href="{$node->url}"{if $node->accesskey != ''} accesskey="{$node->accesskey}"{/if}{if $node->tabindex != ''} tabindex="{$node->tabindex}"{/if}{if $node->titleattribute != ''} title="{$node->titleattribute}"{/if}{if $node->target != ''} target="{$node->target}"{/if}><dfn>{$node->hierarchy}: </dfn>{$node->menutext}</a>

{/if}

{/foreach}
{repeat string="</li></ul>" times=$node->depth-1}</li>
</ul>
{/if}
Thanks!
Kenny

Re: Menu Manager

Posted: Wed Sep 05, 2007 7:28 am
by KO
There is another at the end of the document. If you add class="group" to that It should come up for you.

You could change another name for this template like simple_navigation2.tpl and call it in in menu call
{menu template='simple_navigation2.tpl'} This way you can have different templates for every menu.

i hope this helps.

br, K

Re: Menu Manager

Posted: Wed Sep 05, 2007 7:31 am
by RonnyK
Correct KO,

but be aware that if you have a new template, that it that will become a DB-template instead of a FILE-template. This means that the menu-calling will be done without the ending (.tpl) as that is for file-templates only.

Ronny

Re: Menu Manager

Posted: Wed Sep 05, 2007 1:46 pm
by kcaldwell1123
Thanks Ronny that makes sense.  It didn't even cross my mind to use more than 1 template.  I was so focused in trying to make it all happen with a single template.

Re: Menu Manager

Posted: Wed Sep 05, 2007 1:49 pm
by kcaldwell1123
I guess I should really give Thanks to KO for the answer.  :-[

Thanks for the extra input though Ronny.

Re: [solved] Menu Manager

Posted: Wed Sep 05, 2007 6:53 pm
by KO
That's true that .tpl ending in {menu} call makes difference. It's not necessarily clear first time you do it. Files could be used to reduce database calls but you do benefit only with extremely slow database servers and maybe not even there. Well now you know how to do it which is the main thing.

br, K

Re: [solved] Menu Manager

Posted: Wed Sep 05, 2007 8:21 pm
by Dr.CSS
If you need them to be in the DB templates section, make a copy with notepad or other simple editor and name it with the .tpl saved as All Files then put it in modules/Menu Manager/templates and it should show up as an available template, but will need the .tpl when calling it in menu tag...

ps. untested...