For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
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.
{* 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
Last edited by kcaldwell1123 on Wed Sep 05, 2007 5:46 pm, edited 1 time in total.
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.
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.
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.
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.
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...