Bugs in Menu.item / SiteMap.buildLink

25 views
Skip to first unread message

Debilski

unread,
Jan 12, 2011, 7:58:25 AM1/12/11
to Lift
Hi,

I think I’ve found two issues with Menu.item.

The first is that currently part of the code is

case (Full(loc), _, _) if loc.name == name => {
if (S.attr("donthide").isEmpty) Text("")
if (!text.isEmpty) Group(text)
else Group(loc.linkText openOr Text(loc.name))
}

i.e. in my opinion, checking for the ‘donthide’ attribute does not
change anything.

The second seems to come from SiteMap.buildLink. When building a link,
it is checked for nodeseq.text.length > 0 with the effect that

<lift:Menu.item name="home"><img src="logo.png" /></lift:Menu.item>

shows no image but the default text. But, when surrounded with spaces

<lift:Menu.item name="home"> <img src="logo.png" /> </lift:Menu.item>

it shows the logo as it should.

/rike

Derek Chen-Becker

unread,
Jan 12, 2011, 8:42:50 AM1/12/11
to lif...@googlegroups.com
Let me work on these. Looks like it's going to be a SiteMap/Menu month :-)

Derek




--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.

Kajo Marton

unread,
Jan 21, 2011, 7:55:08 AM1/21/11
to Lift
I have a little desire, if could be possible:

in the documentation to <lift:Menu.item /> there is note, that
" Normally, the Menu item is not shown on pages that match its Menu's
Loc. "

It would be awesome, if I could use some attribute to force this
behaviour and show generated link even on page that match its Menu's
Loc.

I suggest use same attribute as exists in <lift:Menu.builder /> -
linkToSelf="true"

thanks for considering.

On 12. Jan, 14:42 h., "Derek Chen-Becker" <dchenbec...@gmail.com>
wrote:
> Let me work on these. Looks like it's going to be a SiteMap/Menu month :-)
>
> Derek
>
> On Jan 12, 2011 5:58 AM, Debilski &lt;rikebenjamin.schupp...@googlemail.com&gt; wrote:
>
> Hi,
>
> I think I’ve found two issues with Menu.item.
>
> The first is that currently part of the code is
>
>     case (Full(loc), _, _) if loc.name == name =&gt; {
>
>       if (S.attr("donthide").isEmpty) Text("")
>
>       if (!text.isEmpty) Group(text)
>
>       else Group(loc.linkText openOr Text(loc.name))
>
>     }
>
> i.e. in my opinion, checking for the ‘donthide’ attribute does not
>
> change anything.
>
> The second seems to come from SiteMap.buildLink. When building a link,
>
> it is checked for nodeseq.text.length &gt; 0 with the effect that
>
> &lt;lift:Menu.item name="home"&gt;&lt;img src="logo.png" /&gt;&lt;/lift:Menu.item&gt;
>
> shows no image but the default text. But, when surrounded with spaces
>
> &lt;lift:Menu.item name="home"&gt; &lt;img src="logo.png" /&gt; &lt;/lift:Menu.item&gt;

Tim Nelson

unread,
Jan 21, 2011, 8:25:06 AM1/21/11
to lif...@googlegroups.com
+1


On Friday, January 21, 2011 6:55:08 AM UTC-6, Kajo Marton wrote:
I have a little desire, if could be possible:

in the documentation to <lift:Menu.item /> there is note, that
" Normally, the Menu item is not shown on pages that match its Menu's
Loc. "

It would be awesome, if I could use some attribute to force this
behaviour and show generated link even on page that match its Menu's
Loc.

I suggest use same attribute as exists in <lift:Menu.builder /> -
linkToSelf="true"

thanks for considering.

On 12. Jan, 14:42 h., "Derek Chen-Becker" <dchen...@gmail.com>

Derek Chen-Becker

unread,
Jan 21, 2011, 10:05:13 AM1/21/11
to lif...@googlegroups.com

Derek Chen-Becker

unread,
Jan 28, 2011, 6:00:15 PM1/28/11
to lif...@googlegroups.com
This has been committed to 2.3-SNAPSHOT
Reply all
Reply to author
Forward
0 new messages