tgext.menu active class

6 views
Skip to first unread message

Lexa Po

unread,
Dec 4, 2011, 6:57:49 AM12/4/11
to turbo...@googlegroups.com
Hello,

Please give me example how to use active parameter in render_navbar of tgext.menu.

Michael Pedersen

unread,
Dec 4, 2011, 4:55:47 PM12/4/11
to turbo...@googlegroups.com
When you add a navbar entry to a method, you do something like this:

@navbar('My || Spiffy || Menu || Structure')

If you want to tell render_navbar that the menu item which should be given the active class is that one, you would then do this in your template:

render_navbar(active='My||Spiffy || Menu || Structure')

And that's it, you're done.

On Sun, Dec 4, 2011 at 6:57 AM, Lexa Po <lyn...@gmail.com> wrote:
Hello,

Please give me example how to use active parameter in render_navbar of tgext.menu.

--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To view this discussion on the web visit https://groups.google.com/d/msg/turbogears/-/RhS404wses4J.
To post to this group, send email to turbo...@googlegroups.com.
To unsubscribe from this group, send email to turbogears+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en.

Alex Po

unread,
Dec 5, 2011, 2:20:41 AM12/5/11
to turbo...@googlegroups.com
Thank you.

I have placed 
${HTML(render_navbar(active=menu_level))} 
in header template and then passed to template menu_level in controller. 
return dict(menu_level=u'Docs').
Reply all
Reply to author
Forward
0 new messages