Alright, I've got this working. With help from
blue_francis14's post over
here, I was able to write a simple pipe separated menu template. Parent/child distinction isn't really supported; all the active pages (children with inactive parents excluded because that's the way CMSms works) are shown one right after another with the pipe in between. The current page is non-linked. Here it is:
{* Constructed by Nathaniel Robertson (http://twitter.com/robertson_n) (http://forum.cmsmadesimple.org/index.php?action=profile;u=20682) with some help from CMS Made Simple forum member blue_francis14's version.
-----------------------------------------------------------------------------
Use the class .currentpage (no period, that's just the way you'd put it in CSS) to style the display of the menu item for the current page. Use .menuitem to style the other menu items (but not the current page). If you want to style the pipes (or whatever delimiter you change it to), create a span with a class name around them.
*}
{if $count > 0}
{foreach from=$nodelist item=node name=foo}
{if $node->current == true and $smarty.foreach.foo.last == true}
<span class="currentpage">{$node->menutext}</span>
{* more things go after here *}
{elseif $node->current == true}
<span class="currentpage">{$node->menutext}</span> |
{elseif $smarty.foreach.foo.last != true}
<a href="{$node->url}"><span class="menuitem">{$node->menutext}</span></a> |
{else}
<a href="{$node->url}"><span class="menuitem">{$node->menutext}</span></a>
{* more things stop here *}
{/if}
{* end of script around here *}
{/foreach}
{/if}
blue_francis14's
version works fairly well, too, especially if you want your menu in a <ul> list. I wrapped it in a div called
middlenav in my template and used the following CSS to make it horizontal and get rid of the space above and below it when I was trying it out:
#middlenav {
font-size: 17px;
text-align: center;
margin: -1em 0;
}
#middlenav li {
display: inline;
}
The
text-align and the
font-size are really not necessary, it's just what I was using for styling. You may also want to check out
this article to try and get the menu perfectly centered if that's what you want, since the inline displayed list is not perfectly centered even with
text-align: center;. I haven't done it myself, by the way.
Edit: 8.23.09: Edited my code to reflect a fix I made; their were a couple unclosed spans.