[Lift] Menu.builder/Loc.i fetching of resource renders different results

28 views
Skip to first unread message

Peter Petersson

unread,
Oct 28, 2012, 9:50:33 AM10/28/12
to lif...@googlegroups.com
I have noticed that I can't get the full content (html is stripped of)
of the resource string when using Menu.builder but If I use Loc.i for a
single element I get the full content of the resource item.

Is there a way to get around the loss of data using Menu.builder?

For example:
Putting the following in the SiteMap
Menu.i("Home") / "index"

with the resource being
<res name="Home" lang="en" default="true"><i class="icon-home"></i>
Home</res>

Using Menu.builder like this
<span data-lift="Menu.builder"></span>
It will render the resource name "Home" as
" Home"

But using Loc.i like this
<span data-lift="Loc.i">Home</span>
It will render the resource name "Home" as
"<i class="icon-home"></i> Home"

best regards
Peter Petersson



David Pollak

unread,
Oct 29, 2012, 2:56:03 PM10/29/12
to lif...@googlegroups.com
Peter,

Menu.i defines the menu link text as S.?("name"). If we change the method to:

  def i(nameAndLink: String): PreMenu = Menu.apply(nameAndLink, S.loc(nameAndLink, Text(nameAndLink)) /*S ? nameAndLink */)

It should work. Can you make the change and commit the code to master and lift_30 ?

Thanks,

David





--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code






--
Telegram, Simply Beautiful CMS https://telegr.am
Lift, the simply functional web framework http://liftweb.net


Peter Petersson

unread,
Oct 30, 2012, 2:06:47 AM10/30/12
to lif...@googlegroups.com
On 10/29/2012 07:56 PM, David Pollak wrote:
Peter,

Menu.i defines the menu link text as S.?("name"). If we change the method to:

  def i(nameAndLink: String): PreMenu = Menu.apply(nameAndLink, S.loc(nameAndLink, Text(nameAndLink)) /*S ? nameAndLink */)

It should work. Can you make the change and commit the code to master and lift_30 ?

Yes, thank you David, I will make some time for it this weekend.

best regards
   Peter

Peter Petersson

unread,
Nov 3, 2012, 10:43:09 AM11/3/12
to lif...@googlegroups.com
On 10/29/2012 07:56 PM, David Pollak wrote:
Peter,

Menu.i defines the menu link text as S.?("name"). If we change the method to:

  def i(nameAndLink: String): PreMenu = Menu.apply(nameAndLink, S.loc(nameAndLink, Text(nameAndLink)) /*S ? nameAndLink */)

It should work. Can you make the change and commit the code to master and lift_30 ?

Master and lift_30 is now updated with this change. Issue is here [1]

[1] https://github.com/lift/framework/issues/1350

best regards
   Peter Petersson

David Pollak

unread,
Nov 3, 2012, 11:52:03 AM11/3/12
to liftweb
excellent
Reply all
Reply to author
Forward
0 new messages