python - Adding CSS item to Django menu -
i need add css classes menu items. can not figure out how that...
i using django cms, not want client alter menu. have far:
from menus.base import menu, navigationnode menus.menu_pool import menu_pool django.utils.translation import ugettext_lazy _ class mymenu(menu): def get_nodes(self, request): nodes = [] n1 = navigationnode(_('start'), "/", 1) n2 = navigationnode(_('item 1'), "item1/", 2) n3 = navigationnode(_('item 2'), "item2/", 3) nodes.append(n1) nodes.append(n2) nodes.append(n3) return nodes menu_pool.register_menu(mymenu)
my menu looks this:
<ul> <li class="child selected"><a href="/">start</a></li> <li class="child sibling"><a href="item1/">item 1</a></li> <li class="child sibling"><a href="item2/">item 2</a></li> </ul>
but want this:
<ul> <li class="start child selected"><a href="/">start</a></li> <li class="item1 child sibling"><a href="item1/">item 1</a></li> <li class="item2 child sibling"><a href="item2/">item 2</a></li> </ul>
so think need modifier, can not find proper documentation.
i new django, sure miss lot, step step hope done :) in advance!
the show_menu tag renders navigation of current page. can overwrite appearance , html if add menu/menu.html template project. from docs
so in menu.html like:
{% child in children %} here can adjust apperance {% endfor %}
this menu.html used projects: http://pastebin.com/jmzz1gqe
Comments
Post a Comment