On Fri, Mar 20, 2009 at 9:37 AM, Derek Chen-Becker <[email protected]>wrote:
> I'm looking at the code and I can't figure out how to make SiteMap emit the
> entire menu tree, other than to modify Lift core. The sitemap Menu class
> specifically tests against the current path to determine whether children
> are displayed, so it seems like it would be helpful to somehow provide an
> override (constructor param? LiftRules toggle?) that would bypass the path
> test. Am I missing something obvious?
Yes.
for {sm <- LiftRules.siteMap
req <- S.request} yield sm.buildMenu(req.location)
> If not, does it sound reasonable to add something like
>
> LiftRules.expandAllMenus
>
> ?
>
> Derek
>
>
> On Fri, Mar 20, 2009 at 9:48 AM, Derek Chen-Becker
> <[email protected]>wrote:
>
>> Sure, I'll bundle it as part of the widgets module along with some code do
>> handle the nitty-gritty of emitting the full menu and enabling superfish.
>>
>> Derek
>>
>>
>> On Fri, Mar 20, 2009 at 9:30 AM, David Pollak <
>> [email protected]> wrote:
>>
>>>
>>>
>>> On Fri, Mar 20, 2009 at 12:45 AM, Charles F. Munat <[email protected]>wrote:
>>>
>>>>
>>>> It doesn't say anything about licensing on the site, but it's a jQuery
>>>> plugin. I presume that if we can bundle jQuery, we can bundle Superfish.
>>>
>>>
>>> Sounds reasonable. However, I'd prefer not to bundle it with Lift
>>> webkit, but make it like the other widgets.
>>>
>>>
>>>>
>>>>
>>>> Chas.
>>>>
>>>> Derek Chen-Becker wrote:
>>>> > That's awesome. Are there restrictions that would prevent us from just
>>>> > including the superfish script file (and CSS) as part of a widget? It
>>>> > looks like it wants ULs anyways, which is what Lift already outputs.
>>>> > From what DPP said, it should be easy to dump the entire menu as a
>>>> full
>>>> > UL (with nesting), in which case it really is just adding the
>>>> > appropriate <script> element on the page.
>>>> >
>>>> > Derek
>>>> >
>>>> > On Thu, Mar 19, 2009 at 5:43 PM, Charles F. Munat <[email protected]
>>>> > <mailto:[email protected]>> wrote:
>>>> >
>>>> >
>>>> > You should take a look at Superfish:
>>>> >
>>>> > http://users.tpg.com.au/j_birch/plugins/superfish/
>>>> >
>>>> > It's probably the best looking and slickest of the menu bars I've
>>>> seen,
>>>> > and it can work horizontally or vertically. It's pretty accessible
>>>> to
>>>> > persons with disabilities as it's basically implemented via CSS,
>>>> with
>>>> > just a little JQuery to spiff things up.
>>>> >
>>>> > If the Lift code either spit things out so that they were ready to
>>>> be
>>>> > used by Superfish, or at least could be configured (via
>>>> user-specified
>>>> > class attributes, for example) so that Superfish could just drop
>>>> in,
>>>> > that would be great.
>>>> >
>>>> > Might also take a look at the YUI version for those people using
>>>> YUI
>>>> > (I'm using both, though obviously not at the same time).
>>>> >
>>>> > Chas.
>>>> >
>>>> > David Pollak wrote:
>>>> > >
>>>> > >
>>>> > > On Thu, Mar 19, 2009 at 9:50 AM, marius d.
>>>> > <[email protected] <mailto:[email protected]>
>>>> > > <mailto:[email protected]
>>>> > <mailto:[email protected]>>> wrote:
>>>> > >
>>>> > >
>>>> > > I'm wondering if we shouldn't provide this by the means of
>>>> a Lift
>>>> > > widget. Looks like a needed feature ...
>>>> > >
>>>> > > WDYT ?
>>>> > >
>>>> > >
>>>> > > Sounds good to me.
>>>> > >
>>>> > >
>>>> > >
>>>> > > Br's,
>>>> > > Marius
>>>> > >
>>>> > > On Mar 19, 6:43 pm, David Pollak
>>>> > <[email protected] <mailto:
>>>> [email protected]>
>>>> > > <mailto:[email protected]
>>>> > <mailto:[email protected]>>>
>>>> > > wrote:
>>>> > > > On Thu, Mar 19, 2009 at 9:30 AM, Derek Chen-Becker
>>>> > > <[email protected] <mailto:[email protected]>
>>>> > <mailto:[email protected] <mailto:[email protected]
>>>> >>>wrote:
>>>> > > >
>>>> > > > > This is something that has been asked before, but I
>>>> > don't think
>>>> > > there was
>>>> > > > > anything out there. I think that this would be a
>>>> really nice
>>>> > > feature,
>>>> > > > > particularly if it could leverage the existing jQuery
>>>> stuff.
>>>> > > IIRC, the
>>>> > > > > built-in Menu snippet doesn't render children at all
>>>> > unless the
>>>> > > parent is
>>>> > > > > the current selected page, so we would have to either
>>>> modify
>>>> > > that or we
>>>> > > > > could code up a new MenuBar snippet that renders a
>>>> "bar"
>>>> > > instead of a UL
>>>> > > > > like the current one.
>>>> > > >
>>>> > > > There's a way to ask for the entire menu rather than
>>>> just the
>>>> > > current view.
>>>> > > > Dan O'Leary from Enthiosys did this for Innovation
>>>> Games
>>>> > Online.
>>>> > > I've
>>>> > > > pinged him to see if he can share some of the code.
>>>> > > >
>>>> > > >
>>>> > > >
>>>> > > >
>>>> > > >
>>>> > > > > Derek
>>>> > > >
>>>> > > > > On Thu, Mar 19, 2009 at 10:21 AM, DavidV
>>>> > > <[email protected]
>>>> > <mailto:[email protected]>
>>>> > <mailto:[email protected]
>>>> > <mailto:[email protected]>>>wrote:
>>>> > > >
>>>> > > > >> I'm wondering if there is a built-in way to create
>>>> > drop-down menus
>>>> > > > >> from a horizontal navbar using the Menu.builder
>>>> method.
>>>> > These
>>>> > > are the
>>>> > > > >> relevant sections of my current template:
>>>> > > >
>>>> > > > >> <title>My Title<lift:Menu.title /> </title>
>>>> > > > >> <lift:StyleSheet.entryForm />
>>>> > > > >> <lift:StyleSheet.fancyType />
>>>> > > > >> <script id="jquery" src="/classpath/jquery.js"
>>>> > type="text/
>>>> > > > >> javascript"/>
>>>> > > > >> <script id="json" src="/classpath/json.js"
>>>> > > type="text/javascript"/
>>>> > > >
>>>> > > > >> <style>
>>>> > > >
>>>> > > > >> /* <![CDATA[ */
>>>> > > > >> #navbar ul {
>>>> > > > >> margin: 0;
>>>> > > > >> padding: 2px;
>>>> > > > >> list-style-type: none;
>>>> > > > >> font-weight: bold;
>>>> > > > >> text-align: center;
>>>> > > > >> background-color: #C3D9FF;
>>>> > > > >> }
>>>> > > >
>>>> > > > >> #navbar ul li {
>>>> > > > >> display: inline;
>>>> > > > >> }
>>>> > > >
>>>> > > > >> #navbar ul li a {
>>>> > > > >> text-decoration: none;
>>>> > > > >> padding: .2em 1em;
>>>> > > > >> color: #000;
>>>> > > > >> }
>>>> > > >
>>>> > > > >> #navbar ul li a:hover {
>>>> > > > >> color: #fff;
>>>> > > > >> background-color: #000;
>>>> > > > >> }
>>>> > > >
>>>> > > > >> /* ]]> */
>>>> > > >
>>>> > > > >> </style>
>>>> > > > >> </head>
>>>> > > > >> <body>
>>>> > > >
>>>> > > > >> <div class="container">
>>>> > > > >> <div style="text-align: center">
>>>> > > > >> <br/>
>>>> > > > >> <h1 class="alt">
>>>> > > > >> Welcome to the Genomas DNA Banking Database
>>>> </h1>
>>>> > > > >> </div>
>>>> > > > >> <hr/>
>>>> > > >
>>>> > > > >> <div id="navbar">
>>>> > > > >> <ul>
>>>> > > > >> <lift:Menu.builder />
>>>> > > > >> </ul>
>>>> > > > >> </div>
>>>> > > >
>>>> > > > >> <div class="column span-24 last">
>>>> > > > >> <lift:bind name="content" />
>>>> > > > >> </div>
>>>> > > >
>>>> > > > >> I have a couple links on my navbar that have sub-menu
>>>> > links.
>>>> > > I have
>>>> > > > >> constructed them in my Boot.scala file like this:
>>>> > > > >> List(Menu(Loc("SampleLogging", List("samples",
>>>> > "samplelogs"),
>>>> > > > >> "Browse Sample Logging"),
>>>> > > > >> Menu(Loc("Individuals", List("individual",
>>>> > > "individual"),
>>>> > > > >> "Patient Demographics")),
>>>> > > > >> Menu(Loc("Requisition", List("requisition",
>>>> > > "requisition"),
>>>> > > > >> "Requisitions")),
>>>> > > > >> Menu(Loc("Samples2", List("samples",
>>>> "samples"),
>>>> > > > >> "Samples")))) :::
>>>> > > > >> List(Menu(Loc("EditSamp", List("samples",
>>>> "edit"),
>>>> > "Edit",
>>>> > > > >> Hidden))) :::
>>>> > > >
>>>> > > > >> ...and so on.
>>>> > > >
>>>> > > > >> I would like to use some built-in tools to be able to
>>>> make
>>>> > > these sub-
>>>> > > > >> menu items drop downs from the "parent" menu item
>>>> without
>>>> > > having to
>>>> > > > >> build an entirely new complex table-based template.
>>>> Does
>>>> > > anyone know
>>>> > > > >> of a way to accomplish this?
>>>> > > >
>>>> > > > >> Thanks,
>>>> > > > >> David
>>>> > > >
>>>> > > > --
>>>> > > > Lift, the simply functional web
>>>> > frameworkhttp://liftweb.net <http://liftweb.net>
>>>> > > <http://liftweb.net>
>>>> > > > Beginning Scalahttp://
>>>> www.apress.com/book/view/1430219890
>>>> > <http://www.apress.com/book/view/1430219890>
>>>> > > <http://www.apress.com/book/view/1430219890>
>>>> > > > Follow me:http://twitter.com/dpp
>>>> > > > Git some:http://github.com/dpp
>>>> > >
>>>> > >
>>>> > >
>>>> > >
>>>> > > --
>>>> > > Lift, the simply functional web framework http://liftweb.net
>>>> > > Beginning Scala http://www.apress.com/book/view/1430219890
>>>> > > Follow me: http://twitter.com/dpp
>>>> > > Git some: http://github.com/dpp
>>>> > >
>>>> > > >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > >
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Lift, the simply functional web framework http://liftweb.net
>>> Beginning Scala http://www.apress.com/book/view/1430219890
>>> Follow me: http://twitter.com/dpp
>>> Git some: http://github.com/dpp
>>>
>>>
>>>
>>
>
> >
>
--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---