On Aug 14, 11:10 am, "xiaomingzhen...@gmail.com"
<xiaomingzhen...@gmail.com> wrote:
> i am a newer to lift, and now i am reading the book the definitive
> guide to lift. In chapter 5.1, book told me this:
> val helpMenu = Menu(Loc("helpHome",("help" :: "" :: Nil) ->
> true,"Help")) make all the files under help folder accessible, but i
> found the loc object in the Menu item should write like this:
> ("help" :: Nil) -> true. Is that book wrong?
>
> and sometimes i wrote Menu(Loc("Home", "/", "Home")) and got a compile
> wrong, and i have to write Menu(Loc("Home", "/" :: Nil, "Home")). i
> have imported Loc._, why "/" string can not convert to a list? is that
> a lift bug?

String and List are unrelated types. You can write if you want in
implicit conversion function but IMHO is not worth it.

Menu(Loc("Home", List("/"), "Home"))
For this construct Lift already has an implicit conversion
strLstToLink from a Seq[String] to a Link which is what Loc apply
expects.

So List[String] is expected because a path is not expressed as a plain
string but rather as a List of path parts.


>
> besides, does all pages accessible in lift project must be import to
> Sitemap?

To access a page you should put it in the SiteMap. You can choose to
not use SiteMap at all but rather work only with DispatchPF and so on,
but for a web application this is impractical.

>if so, when the website is large, the work may be tiring?

You only define the sitemap once. You can break it to modules etc.
that return specific lists of Menus but that's about application
design. If you're doing RIA style application you'll probably won't
need a tremendous amount of pages anyways.

--~--~---------~--~----~------------~-------~--~----~
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