Actually, my feeling on item is that if you're on that page, item should 
return placeholder text (i.e. the same text without the link). For me, 
at least, that's the most common scenario.

Chas.

bradford wrote:
> 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 tips, Chas.
> 
> Derek, if you do add "always" can you please let me know so that I can
> update my code.
> 
> Thanks,
> Bradford
> 
> On Mar 24, 10:37 pm, Derek Chen-Becker <dchenbec...@gmail.com> wrote:
>> 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:Menu.item name="foo"><span>Go here</span></lift:Menu.item>
>>
>> should become
>>
>> <a href={foo location}><span>Go here</span></a>
>>
>> Am I misunderstanding what you're looking for there? As for #2, you should
>> be able to add a class using the prefixed attribute:
>>
>> <lift:Menu.builder li_item:class="bar" />
>>
>> In this context, li_item is the menu item that matches the current page.
>> With Menu.group, you can specify the binding template:
>>
>> <ul>
>> <lift:Menu.group group="help">
>>   <li class="bar"><menu:bind /></li>
>> </lift:Menu.group>
>> </ul>
>>
>> But there's no provision to do anything special for the current page.
>>
>> Let me know if that's not sufficient or if I'm misunderstanding your
>> requirement.
>>
>> Derek
>>
>> On Tue, Mar 24, 2009 at 3:50 PM, bradford <fingerm...@gmail.com> 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 <feeder.of.the.be...@gmail.com>
>>> wrote:
>>>> On Tue, Mar 24, 2009 at 9:02 AM, Charles F. Munat <c...@munat.com>
>>> 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 liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to