| OVERVIEW | PACKAGE | CONSTR | FIELDS | METHODS | FRAMES NO FRAMES | INHERITED |
object Menu
extends
DispatchSnippet with ScalaObject
This built-in snippet can be used to render a menu representing your SiteMap. There are three main snippet methods that you can use:
More detailed usage of each method is provided below
def this
|
| dispatch.. |
def dispatch
|
PartialFunction |
| !=.. |
final def !=(arg0 : Object)
|
Boolean | AnyRef |
| !=.. |
final def !=(arg0 : Any)
|
Boolean | Any |
| ==.. |
final def ==(arg0 : Any)
|
Boolean | Any |
| ==.. |
final def ==(arg0 : Object)
|
Boolean | AnyRef |
| asInstanceOf.. |
final def asInstanceOf[T0]
|
T0 | Any |
| builder.. |
def builder(info : NodeSeq)
This snippet method renders a menu representing your SiteMap contents [details]
The
menu is rendered as a set of nested unordered lists (<ul />). By
default, it only renders nested child menus for menus that match the current request path.
You can add the "expandAll" attribute to the snippet tag to force full expansion of
all child menus. Additionally, you can use the following attribute prefixes to further customize
the generated list and list item elements:
For a simple, default menu, simply add
<lift:Menu.builder />
To your template. You can render the entire sitemap with
<lift:Menu.builder expandAll="true" />
Customizing the elements is handled through the prefixed attributes described above. For instance, you could make the current page menu item red:
<lift:Menu.builder li_item:style="color: red;" />
|
NodeSeq | |
| clone.. |
protected def clone
|
Object | AnyRef |
| eq.. |
final def eq(arg0 : Object)
|
Boolean | AnyRef |
| equals.. |
def equals(arg0 : Any)
|
Boolean | AnyRef |
| finalize.. |
protected def finalize
|
Unit | AnyRef |
| getClass.. |
final def getClass
|
Class[Any] | AnyRef |
| group.. |
def group(template : NodeSeq)
Renders a group of menu items [details]
You specify a group using the LocGroup LocItem
case class on your Menu Loc:
val menus =
Menu(Loc("a",...,...,LocGroup("test"))) ::
Menu(Loc("b",...,...,LocGroup("test"))) ::
Menu(Loc("c",...,...,LocGroup("test"))) :: Nil
You can then render with the group snippet: <lift:Menu.group group="test" /> Each menu item is rendered as an anchor tag (<a />), and you can customize the tag using attributes prefixed with "a": <lift:Menu.group group="test" a:class="menulink" /> You can also specify your own template within the Menu.group snippet tag, as long as you provide a <menu:bind /> element where the snippet can place each menu item:
<ul>
<lift:Menu.group group="test" >
<li><menu:bind /></li>
</lift:Menu.group>
|
NodeSeq | |
| hashCode.. |
def hashCode
|
Int | AnyRef |
| isInstanceOf.. |
final def isInstanceOf[T0]
|
Boolean | Any |
| item.. |
def item(text : NodeSeq)
Renders a specific, named item, based on the name given in the Menu's Loc paramter:
val menus =
Menu(Loc("a",
[details]
|
NodeSeq | |
| jsonMenu.. |
def jsonMenu(ignore : NodeSeq)
|
NodeSeq | |
| ne.. |
final def ne(arg0 : Object)
|
Boolean | AnyRef |
| notify.. |
final def notify
|
Unit | AnyRef |
| notifyAll.. |
final def notifyAll
|
Unit | AnyRef |
| synchronized.. |
final def synchronized[T0](arg0 : T0)
|
T0 | AnyRef |
| title.. |
def title(text : NodeSeq)
Renders the title for the current request path (location) [details]
You can use this to
automatically set the title for your page based on your SiteMap:
...
<head>
<title><lift:Menu.title /></title>
</head>
...
|
NodeSeq | |
| toString.. |
def toString
|
String | AnyRef |
| wait.. |
final def wait(arg0 : Long, arg1 : Int)
|
Unit | AnyRef |
| wait.. |
final def wait
|
Unit | AnyRef |
| wait.. |
final def wait(arg0 : Long)
|
Unit | AnyRef |
| OVERVIEW | PACKAGE | CONSTR | FIELDS | METHODS | FRAMES NO FRAMES | INHERITED |