Re: Determining the active urlpattern for navigational templates

2008-10-18 Thread Jesse Young
Hi Nathaniel, I just cleaned up my implementation and posted it (along with some usage notes) at http://demo.apture.com/demo/ifactive.py . I modified it from my original implementation, so now it doesn't require patching Django. It does require adding a middleware class, though. Although, if peo

Re: Determining the active urlpattern for navigational templates

2008-10-17 Thread Nathaniel Whiteinge
On Oct 16, 8:29 pm, Jesse Young <[EMAIL PROTECTED]> wrote: > My idea (implemented in my local version of Django) was to > modify RegexURLResolver to return the urlpattern that was used, and > store that (as well as the kwargs) as a property of the request. > > Does this seem like a useful patch? O

Re: Determining the active urlpattern for navigational templates

2008-10-17 Thread Jesse Young
Hey Steve, Thanks for the suggestions. Setting aside the matter of using extends vs. include, or using data-driven menus vs. hardcoded menus, the key issue is how to figure out which of the links corresponds to the current page. >From your code sample, it looks like you're comparing request.path

Re: Determining the active urlpattern for navigational templates

2008-10-16 Thread Steve Holden
Jesse Young wrote: > I'm guessing it's somewhat common (as usual, I think it's common > because I do it) to put several navigational links in a template that > is included from several other templates, e.g.: > > Page 1 > Page 2 > ... > Page N > > But also, it's helpful to indicate where the user c

Determining the active urlpattern for navigational templates

2008-10-16 Thread Jesse Young
I'm guessing it's somewhat common (as usual, I think it's common because I do it) to put several navigational links in a template that is included from several other templates, e.g.: Page 1 Page 2 ... Page N But also, it's helpful to indicate where the user currently is in the navigational hiera