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).
Source: stackoverflow.com
Related Query
- Liftweb submenus with Loc definition
- liftweb menu with submenus
- Scala - ambiguous reference to overloaded definition -- with varargs
- Complex SQL Query With Join In Liftweb
- Hyphenated sub project names with new sbt 0.13 multi-project definition
- Scala Liftweb - pattern type is incompatible with expected type
- Json implicit format with recursive class definition
- Error with definition covariant and contravariant types
- How to avoid syntax overhead for def definition with pattern matching in Scala?
- Using @Transactional on actors class definition with Akka 2.X.X?
- Why does a scala val definition with a dot in it produce an error in a later stage than parsing?
- Intellij sbt plugin with project definition in project/Build.scala
- Strange definition and call of a function with curly bracket in Scala (function as parameter of a function)
- When are two classes with same definition and classpath chosen ambiguously in Scala with SBT and Ivy?
- Scala - understand class definition with Bounds
- Liftweb - Maximum value of a SQL table field with mapper
- NextExecution time with quartz definition fails when date if the end of the month
- Spark Dataframe schema definition using reflection with case classes and column name aliases
- Intersection type with type definition
- Does Scala Optimize Method Definition with a Constant Return Value?
- Scala ambiguous reference to overloaded definition with two implicit parameters
- Scala - difference between function definition and function literal with no arguments
- Whether to copy or extend megaprotouser or metaprotouser to integrate liftweb with existing database
- Playframework - JSON parsing object with single field - definition issue
- How to achieve tail -F functionality with Scala in Liftweb
- How to read CSV files with header definition in a separate file?
- What is wrong with the method definition
- "Forward reference extends over definition value exp" when using an abstract class with case classes of a Scala tutorial
- Zeppelin with Spark interpreter ignores imports declared outside of class/function definition
- Sending email with attachment using scala and Liftweb
More Query from same tag
- Create nested Java TreeMap in Scala
- Scala's for comprehension for Futures and Options
- how to package spark scala application
- Can I use a fold function to implement pack functionality?
- Portable hashCode implementation for binary data
- Information and management of the akka cluster using JMX console
- Is there or will there be a Scala collection extending Seq with faster iteration than Array?
- Is it a rule that unapply will always return an Option?
- How to reduce multiple string values to predefined categories in a column
- Play-Scala format date from yyyy-mm-dd to dd MMM YYYY
- Get subsets of a range of sizes in Scala?
- update value of Accumulator in dtaframe.map function
- How to get the actorRef of the failing actor in a OneForOneStrategy setup?
- Storing a value without using val
- Spark application got the error of "Task not serializable"?
- Intercept Akka HTTP WebSocket events on socket close in Scala
- Scala: Breeze (scalanlp.org) syntax?
- enable macro paradise to expand macro annotations
- Scalaz - runnable monad
- Calculation of areaUnderROC of logistic regression model in Spark
- scala: generating tuples from a list
- Scala accept both parameterless function and zero-parameter function as overloads
- Slick 2.10-RC1, Scala 2.11.x, bypassing 22 arity limit with case class (heterogenous)
- Writing ScalaTest for ReactiveMongoApi in Playframework 2.4?
- How to add conditional join in spark
- twitter4j since id not getting updated
- Akka finite state machine instances
- Before and After in the same trait
- What's the difference between these two calls to a function taking a collection of structural types?
- Confused about this Scala syntax