On 20 January 2011 06:49, hollando <hrqi...@gmail.com> wrote: > I'm building my application with the admin site. > As a start point, it make things so easy. > However, I want to add a top menu that links to my apps and some of > the dynamic pages. > My top menu is kinda simple. Unlike treemenu, it's just flat menu with > a few items. > One solution I can think of is by modifying base_site.html, add my > menu onto it. > But I want to high light the app that is currently been choose. > What is the best way to do this? Thanks
Hi, I'm not quite sure why you want to pick the app, but the solution would be to use a context processor [1], find a view based on request's url [2] and determine the application based on the result. Then, you can pass that into your template to enable/disable menu highlight css class. cheers, Konrad [1] http://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-context-processors [2] http://docs.djangoproject.com/en/dev/topics/http/urls/#resolve -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.