[Lift] Re: lift:Menu.group

2009-03-31 Thread bradford
So, how would I test this function in specs? I would need to create a mock object of S, right? Thanks, Bradford On Mar 29, 8:02 pm, bradford fingerm...@gmail.com wrote: This can probably be improved (and I've done little testing on it), but I've come up with something to satisfy my

[Lift] Re: lift:Menu.group

2009-03-29 Thread bradford
This can probably be improved (and I've done little testing on it), but I've come up with something to satisfy my description above: def group(template: NodeSeq): NodeSeq = { val default = S.attr(default).openOr() val active_attrs = S.prefixedAttrsToMetaData(active)

[Lift] Re: lift:Menu.group

2009-03-28 Thread bradford
Derek, I saw the changes and noticed that it doesn't capture the a attributes anymore. I just wanted to point it out, because I wasn't sure if that was intended or not. Ok, I finally came up with a design for what I'm looking for: lift:MyMenu.group active:class=selected default=home

[Lift] Re: lift:Menu.group

2009-03-28 Thread bradford
Ok, I'm stuck now. I can't figure out how to mixin the prefixed attributes of menu:bind with the links. Here's what I have so far (mostly copied from BindHelpers.scala: import scala.xml._ object Main { def group(template: NodeSeq): NodeSeq = { val active_attrs = a class=selected

[Lift] Re: lift:Menu.group

2009-03-28 Thread Derek Chen-Becker
Argh, stupid mistake on not capturing attrs. I'm pushing a fix up to git in about 10 minutes. With this fix, is there still a reason that you need to build your own MyMenu.group snippet? Derek On Fri, Mar 27, 2009 at 7:02 PM, bradford fingerm...@gmail.com wrote: Derek, I saw the changes and

[Lift] Re: lift:Menu.group

2009-03-26 Thread bradford
Derek, that'll work :) Thanks, Bradford On Mar 25, 6:13 pm, Derek Chen-Becker dchenbec...@gmail.com wrote: That seems reasonable to me. That's actually what the Menu.builder does, essentially. I don't think we want to modify the default behavior, but I could make it a donthide attribute

[Lift] Re: lift:Menu.group

2009-03-26 Thread Derek Chen-Becker
It's in trunk now. Add the donthide attribute to your Menu.item tags and you'll get the same text as you would normally, just not in link form. Derek On Wed, Mar 25, 2009 at 4:31 PM, bradford fingerm...@gmail.com wrote: Derek, that'll work :) Thanks, Bradford On Mar 25, 6:13 pm, Derek

[Lift] Re: lift:Menu.group

2009-03-25 Thread bradford
David, you're right that needing to surround the element text of a with span is a unique case and should be a custom snippet. I've removed the span now and think that Derek's addition of always would be just what I need. Adding group=foo to Menu.builder would suffice as well. Thanks for the

[Lift] Re: lift:Menu.group

2009-03-25 Thread bradford
Please don't shoot me for bringing this up again. I still don't think the current behavior of Menu.item makes sense. If the user doesn't want that link to appear on the page, then they shouldn't include lift:Menu.item name=foo1 / in its source. Most people put text around their link:

[Lift] Re: lift:Menu.group

2009-03-24 Thread bradford
Thanks Derek. I'll give this a shot when I get home. I don't quite understand the purpose of Menu.item, then. Isn't Menu.item what you all use to create links so that they aren't hard coded in all of the pages? What's the best practice: For more information about lift:Menu.item name=foo1 /.

[Lift] Re: lift:Menu.group

2009-03-24 Thread David Pollak
On Tue, Mar 24, 2009 at 6:55 AM, bradford fingerm...@gmail.com wrote: Thanks Derek. I'll give this a shot when I get home. I don't quite understand the purpose of Menu.item, then. Isn't Menu.item what you all use to create links so that they aren't hard coded in all of the pages? Yes.

[Lift] Re: lift:Menu.group

2009-03-24 Thread bradford
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

[Lift] Re: lift:Menu.group

2009-03-24 Thread Charles F. Munat
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

[Lift] Re: lift:Menu.group

2009-03-24 Thread Derek Chen-Becker
The general case is that a page won't link to itself, I think, which is why the default isn't to show it when the page matches. Unless anyone has objections I can add an always attribute. As for #1, the Menu.item makes a link using whatever the contents of the Menu.item tag are for the link text:

[Lift] Re: lift:Menu.group

2009-03-23 Thread bradford
Also, I'm using 1.1-snapshot and lift:Menu.item name=foo1 / will always show except when i am on /foo1. For this case it doesn't even render. On Mar 23, 8:41 pm, bradford fingerm...@gmail.com wrote: The idea of LocGroup is great.  I have a few Menu's with LocGroup (group1).  I want to

[Lift] Re: lift:Menu.group

2009-03-23 Thread bradford
I apologize for all of the messages. I got a little hasty with this email. This is what I'm looking for: ul class=menu lia href=/foo1spanFoo1/span/foo lia href=/foo2spanFoo2/span/foo lia href=/foo3spanFoo3/span/foo /ul On Mar 23, 8:41 pm, bradford fingerm...@gmail.com wrote: The idea of