alright, I fixed it.  apparently in old versions of layout.html the =MENU() 
is used to create the html menu from response.menu.  that code has been 
updated at some web2py version and changed to:

          {{for _item in response.menu or []:}}
          {{if len(_item)<4 or not _item[3]:}}
          <li class="nav-item {{if _item[1]:}}active{{pass}}">
            <a class="nav-link" href="{{=_item[2]}}">{{=_item[0]}}</a>
          </li>
          {{else:}}
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="{{=_item[2]}}" 
data-toggle="dropdown" aria-haspopup="true" 
aria-expanded="false">{{=_item[0]}}</a>
            <div class="dropdown-menu">
              {{for _subitem in _item[3]:}}
              <a class="dropdown-item" href="{{=_subitem[2]}}">{{=_subitem[0
]}}</a>
              {{pass}}
            </div>
          </li>
          {{pass}}
          {{pass}}

thanx to Anthony, I rewrote the above code to allow for the insertion 
divider/separator in the response.menu to:

          {{for _item in response.menu or []:}}
          {{if len(_item)<4 or not _item[3]:}}
          <li class="nav-item {{if _item[1]:}}active{{pass}}">
            <a class="nav-link" href="{{=_item[2]}}">{{=_item[0]}}</a>
          </li>
          {{else:}}
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="{{=_item[2]}}" 
data-toggle="dropdown" aria-haspopup="true" 
aria-expanded="false">{{=_item[0]}}</a>
            <div class="dropdown-menu">
              {{for _subitem in _item[3]:
                  if (len(_subitem) > 2):
                    =A(_subitem[0], _href=_subitem[2], _class=
"dropdown-item")
                  else:
                    =_subitem
                    pass
                  pass}}
            </div>
          </li>
          {{pass}}
          {{pass}}

in which case, the response.menu now looks like:

response.menu = [
    [T('Lectures'), False, None, []],
    [T('Students'), False, URL('main', 'students'), []],
    [T('Professors'), False, URL('main', 'professors'), []],
    [T('Blog'), False, URL('default', 'blog')],
    [T('News'), False, URL('default', 'news')]
    ]


if auth.is_logged_in():
    response.menu[1][0] = T('Student')
    response.menu[1][3] = [
        (T('Dashboard'), False, URL('main', 'students')),
        DIV(_class="dropdown-divider"),
        (T('Assessments'), False, None),
        (T('History'), False, None),
        (T('Join a Class'), False, None)
        ]

where the DIV is added with the class to style it nicely, in which in my 
css file I added:

div.dropdown-menu div.dropdown-divider { width: 100%; height: 4px; margin: 
3px 0px; background-color: #f0c36d; }

and it works perfectly and looks beautifully.  thanx to mweissen his 
suggestion, it worked pretty well also.

qed, lucas


-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to