On Apr 16, 2007, at 11:57 PM, Jorge Godoy wrote:
> > Alberto Valverde <[EMAIL PROTECTED]> writes: > >> On Apr 16, 2007, at 10:23 PM, Christoph Zwerschke wrote: >> >>> >>> I wonder why the current request path is not available as a global >>> template variable (e.g. as tg.path = cherrypy.request.path). I think >>> that would be very handy for displaying navigation, breadcrumbs, >>> menus >>> etc. in the template. And instead setting a flag in the controller >>> it is >>> often easier to check the path directly. >>> >>> Shall I submit this as a patch or am I missing something? >> >> You can add whatever variables your app needs to the template >> namespae by appending a function to view.variable_providers >> >> def my_vars(d): >> d['path'] = cherrypy.request.path >> >> from turbogears import view >> view.varibale_providers.append(my_vars) > > Yes, but having it there by default is a big win... ;-) Sounds reasonable, mind anyone opening a "patched" ticket at the Trac? :) Thanks, Alberto --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~---
