Question

I'm trying to modify the boot.scala in lift and running into a funny error. This is what I currently have:

val entries = Menu(Loc("Home", List("index"), "Home")) ::
    Menu(Loc("StudentLogin", List("studentlogin"), "Student Login"))  ::
    Menu(Loc("ProviderLogin", List("providerlogin"), "Provider Login")) 

    LiftRules.setSiteMap(SiteMap(entries :_*))

I get this error:

Boot.scala:29: error: value :: is not a member of net.liftweb.sitemap.Menu Menu(Loc("StudentLogin", List("studentlogin"), "Student Login")) ::

any ideas about what I might be doing wrong?

Thanks.

Was it helpful?

Solution

Looks like you're trying to build a list with cons without having an empty list at the end. Try this instead

val entries = Menu(Loc("Home", List("index"), "Home")) ::
Menu(Loc("StudentLogin", List("studentlogin"), "Student Login"))  ::
Menu(Loc("ProviderLogin", List("providerlogin"), "Provider Login")) :: 
Nil

LiftRules.setSiteMap(SiteMap(entries :_*))

OTHER TIPS

Please take a look at the SiteMap wiki page as well: http://liftweb.assembla.com/wiki/show/liftweb/SiteMap

The new and improved SiteMap syntax is:

def siteMap() = SiteMap(
  Menu(S ? "Home") / "index",
  Menu(S ? "About") / "about" / "index" submenus (
    Menu(S ? "Management") / "about" / "management",
    Menu(S ? "Goals") / "about" / "goals"),
  Menu("directions", S ? "Directions") / "directions" >> Hidden,
  Menu(S ? "Admin") / "admin" / "index" >> If(loggedIn_?, "You must be logged in"))

Not using the :: operator might be more readable:

val entries = List(Menu(Loc("Home", 
                        List("index"), "Home")),
                   Menu(Loc("StudentLogin", 
                        List("studentlogin"), "Student Login")),
                   Menu(Loc("ProviderLogin", 
                        List("providerlogin"), "Provider Login")))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top