Folks,
I've made a bunch of updates to SiteMap and Lift's built-in snippets.
When you define a Menu Location (Loc()), you specify a "name" as the first parameter. That name now has a use.
You can now insert a menu item on a page with <lift:Menu.item name="item_name"/> If the menu item can be displayed, an <a href="...">text</a> will be generated, otherwise a blank will be returned. That way you can do <lift:Menu.item name="Login"/><lift:Menu.item name="Logout" /> next to each other and only the Log In or Log Out link will be displayed.
But wait... there's more... <lift:Menu.item name="foo"><b>Very Foo</b></lift:Menu.item> will put "<b>Very Foo</b> in the link rather than the default link text.
But wait... there's more... <lift:Menu.item name="foo" a:class="my_class" a:onclick="javascript:"/> will put "class" and "onclick" attributes on the generated <a /> tag.
But wait... there's more... <lift:Menu.builder ul:class="class_for_ul_tag" li:class="class_for_li_tags" li_item:class="class_for_current_page" li_path:class="class_for_breadcrumb_path"/>
Note that the suffixes for any given prefix (a, ul, li, li_item, etc.) can be anything and unprefixed attributes are created for these items.
Thanks,
David
--
Lift, the simply functional web framework
http://liftweb.net
Collaborative Task Management
http://much4.usFollow me:
http://twitter.com/dppGit some:
http://github.com/dpp