score:1

Accepted answer

i believe you just pass the submenus as the second parameter to menu. so:

val adminloginrequired = user.loginfirst
val sitemap = list(
  menu(loc("home", "index" :: nil, "home")),
  menu(
    loc("admin", "admin" :: nil, "admin", adminloginrequired, locgroup("admin")),
    admin_sitemap: _*
  )
) ::: customer.menus ::: user.menus ::: product.menus

however you can convert the old "direct" format to the new dsl format. assuming you don't need to localize the menu labels, and you don't care about the menus' internal names:

val sitemap = list(
  menu("home") / "index",
  menu("admin" / "admin" >> adminloginrequired >> locgroup("admin") submenus (admin_sitemap: _*)
)) ::: customer.menus ::: user.menus ::: product.menus

to make the label localizable, use menu.i instead of plain menu, and to specify the internal name pass it first, as in menu("menuhome", "home"). apparently you can't do that with menu.i (i guess no one thought of it).


Related Query

More Query from same tag