On Tuesday, September 13, 2016 at 1:02:54 PM UTC-7, Peter wrote:
>
> I am trying to get a menu item to display additional selectable drop down
> options...
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *default.pyif auth.user: response.menu=[ ( 'Home'
> , False , url( 'index' ) , []), ( 'Companies'
> , False , url( 'list_companies' ) , []), ( 'Contacts'
> , False , url( 'list_persons' ) , []), ( 'Activities' ,
> False , url( 'list_tasks' ) , []), ( 'Invoices' ,
> False , url( 'list_invoices' ) , []), ( 'Payments' ,
> False , url( 'list_payments' ) , [ ( 'Activity'
> , False , url( 'list_unpaid_activities' ) , []),
> ( 'Invoice' , False , url( 'list_unpaid_invoices' ) , []),
> ]),
> ( 'Reports' , False , url( 'list_reports' ) , [])
> ]layout.html*
> <div id="menu">
> {{=MENU(response.menu)}}
> </div>
>
>
> The result from above code produces the submenu options permanently below
> the parent option and horizontally aligned (see attached).
>
>
> I have read through the online doc but the references are not helping me,
> I can see gluon.tools auth has navbar with methods ''menu'', ''bootstrap3''
> and ''bare'' but I have no idea how to assign response.menu (or invoke the
> MENU wrapper) correctly?
>
> Does the menu need to be custom coded (as per the comments section under
> the 'bare' function in navbar) or is there something I am doing wrong in
> the code above?
>
> any help would be appreciated! Thanks.
>
>
The change to Bootstrap3 limited the nesting levels of submenus ... only 1
sub-level now, I believe. This was a reflection of the popularity of
portable devices, where a tree of menus runs out of screen space.
I think that the Stupid.css layout allows you to have multiple nesting
levels, and you can look at the new version of the "examples" app for
ideas. (There's also a demo site where Massimo did a little showing-off
with stupid.css:
<URL:http://mdipierro.github.io/stupid.css/themes/random.html>
for some random ideas)
Of course, if you have an existing app, converting to stupid.css may be
messy, but the other choice seems to be to do some custom scripting.
/dps
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.