li_class on Menu doesn't work

50 views
Skip to first unread message

Diogo Munaro

unread,
Oct 10, 2013, 10:08:42 AM10/10/13
to web...@googlegroups.com
Hey guys, I have a menu with 3 elements.

When I try it:

{{=MENU(response.contextmenu,_
class="catalogo_topo_menu",li_class='textcenter',li_first="textcenter",li_last="textcenter")}}

only li_first and li_last work... The first and last items ares filled with the class, but the middle item doesn't get a class.

What's happening?

My result:

<li class="textcenter"> … </li>
<li> … </li>
<li class="textcenter"> … </li>

Using:
2.7.2-stable+timestamp.2013.10.07.13.52.24
(Running on Apache/2.2.22 (Ubuntu), Python 2.7.4)

By now, the workaround is using the ul item to set li classes, but I'll can't do it in the future

Thx for help

Diogo Munaro

unread,
Oct 11, 2013, 4:21:33 PM10/11/13
to web...@googlegroups.com
Nobody knows?

Massimo Di Pierro

unread,
Oct 11, 2013, 5:33:26 PM10/11/13
to web...@googlegroups.com
li_class is only used for list items which contain sub-menus. It is not for mid elements.
I do not think anything has changed there. Do you think it has?


Massimo

Diogo Munaro

unread,
Oct 11, 2013, 6:19:09 PM10/11/13
to web...@googlegroups.com
Thx Massimo, but how could I make it?

It's working with first and last. How could I insert for mid elements?




2013/10/11 Massimo Di Pierro <massimo....@gmail.com>

--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/rN2193EIJxA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Massimo Di Pierro

unread,
Oct 11, 2013, 6:59:44 PM10/11/13
to web...@googlegroups.com
But why do you need it? You can refer to elements using 

jQuery('.catalogo_topo_menu li') and you can use the jQuery addClass method to do it client side.

Massimo

Diogo Munaro

unread,
Oct 11, 2013, 9:20:42 PM10/11/13
to web...@googlegroups.com

Ok, thx... li_first and li_last confused me. I think I could put mid li classes on server side like li_first and li_last do.

Thx for explanation

Reply all
Reply to author
Forward
0 new messages