Thanks Anthony for your reply. But actually this didn't help me. Your
code still would set the class for the outer UL element and generate
the following html. As you can see the <li> tag -- line 3 -- is still
without a class name. It seems that there is no way to set a class
name for this tag using web2py. Am I right? Thanks you again! =)

1. <div id="menu">
2.    <ul class="your-custom-class">
3.       <li>
4.          <a href="/myApp/default/index">Home</a>
5.       </li>
6.    </ul>
7. </div>


On Feb 14, 8:52 pm, Anthony <[email protected]> wrote:
> > the default MENU helper sets the class for the outer UL elements to
> > "sf-menu". There are optional arguments to set the class of the inner
> > UL and LI elements. What I need is a way to set the class for the
> > first level (outer) LI element. Is there any way to do this other than
> > using JavaScript/jQuery, i.e. with arguemtns?
>
> Actually, the default class for the outer UL is "web2py-menu
> web2py-menu-vertical". It is explicitly set to "sf-menu" in layout.html of
> the "welcome" app (so it works properly with Superfish):
>
> <div id="menu">
>     {{=MENU(response.menu, _class='mobile-menu' if is_mobile else
> 'sf-menu', mobile=is_mobile)}}
> </div>
>
> As you can see, all you have to do is set the _class argument:
>
> {{=MENU(response.menu, _class='your-custom-class')}}
>
> Anthony

Reply via email to