wow works like a dream :) perfect time saver bit of script thanks :) On Jul 15, 6:00 pm, natebeacham <nate.beac...@gmail.com> wrote: > Or, if you don't want to over complicate things... > > $(function() { > $('#nav li a').each(function() { > if ($(this).attr('href') == window.location.pathname) { > $(this).addClass('active'); > } > }); > > }); > > On Jul 15, 12:15 pm, David De La Harpe Golden > > > > <david.delaharpe.gol...@ichec.ie> wrote: > > On 15/07/10 16:31, justin jools wrote: > > > > I thought I had solved but I haven't. > > > [...] > > > using seperate block nav for evey page seems like a lot of > > > duplication... > > > Well, you could also pass through a context variable to the template > > from each of your view functions telling what item in your navbar to > > make current, you don't need to do the "{%with ...%}{{block.super}}" > > hack I showed, that just helps make which navbar item is current a > > "purely in the templates" issue, which is potentially handy. > > > i.e. in your view you might do something like > > > return render_to_response('blah.html', > > dict(nav_current='blah',...), > > context_instance=RequestContext(request))- Hide quoted text - > > - Show quoted text -
-- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.