Bradford, It's easy to change this. I needed similar capabilities. So I simply copied the Menu.scala file into my own file and changed it to MyMenu.scala. Then it's a very quick fix to adapt the item, etc. methods to your own purposes. Took me five minutes, and I had complete control.
Just because it's built into Lift doesn't mean you can't override it. And by copying the Lift code, I had most of the work done for me. I've done this with lots of other code. For example, I just recently rewrote the Msgs code so that I could include a default NodeSeq and it outputs that when there is no notice, warning, or error. If something seems to be worth it to other people, sometimes your code will be pulled in. I rewrote S once to make it easy to add attributes to things, and David ended up using those changes (after rewriting them into much better Scala). Consider it. Chas. bradford wrote: > Thanks for the clarification, David, and for your snippet, Derek. > > I think adding an "always" attribute to Menu.item would be very > beneficial. I still don't understand why that's not its default > behavior. > > It looks like I will not be able to use any of lift's Menu tags at > this time, because 1) I need to surround the item text with span and > 2) I need a way to add class="active" to the li_item. Both are not > possible with Menu.item, Menu.group, or Menu.builder. Let me know if > I am mistaken. If I am not not, may I put in a feature request for > these items. For the time being I will just hard code it as follows > (which is not a big deal to me at this time): > > <ul class="menu"> > <li><a href="/foo1" class="active"><span>Foo1</span></foo> > <li><a href="/foo2"><span>Foo2</span></foo> > <li><a href="/foo3"><span>Foo3</span></foo> > </ul> > > Thanks again for the great support :) > > Bradford > > On Mar 24, 12:08 pm, David Pollak <[email protected]> > wrote: >> On Tue, Mar 24, 2009 at 9:02 AM, Charles F. Munat <[email protected]> wrote: >> >> >> >> >> >>> David Pollak wrote: >>>> What's the best practice: >>>> For more information about <lift:Menu.item name="foo1" />. For more >>>> information about <lift:Menu.item name="foo2" />. >>>> Or >>>> For more information about <a href="/foo1">foo1</a>. For more >>>> information about <a href="/foo2">foo2</a>. >>>> The latter. This allows you to move the pages around on the filesystem >>>> without having to grep through all you source files looking for what >>>> needs to be changed. >>> Am I missing something, or did you mean the former? >> D'oh! That brain-finger connection is always getting messed up. I meant >> the former. Thanks for correcting me! >> >> >> >>> Chas. >> -- >> Lift, the simply functional web frameworkhttp://liftweb.net >> Beginning Scalahttp://www.apress.com/book/view/1430219890 >> Follow me:http://twitter.com/dpp >> Git some:http://github.com/dpp > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
