Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1097 (closed enhancement: fixed)

Opened 11 years ago

Last modified 10 years ago

[PATCH] Add variables to template root, not just in tg. namespace

Reported by: arnarbi Owned by: anonymous
Priority: normal Milestone: 1.0b2
Component: Kid Version: 0.9a6
Severity: normal Keywords:
Cc:

Description

Sometimes you want to add generic template variables to the root of the template context, for all views. Templates can be added to the tg. namespace by appending a callable to turbogears.view.variable_providers - it would be nice to be able to do something similar to add variables to the root of the context.

See attached patch for the general idea..

Attachments

tg_global_vars.diff Download (779 bytes) - added by arnarbi 11 years ago.

Change History

Changed 11 years ago by arnarbi

comment:1 Changed 11 years ago by jorge.vargas

  • Milestone set to 1.0b2
  • Component changed from CherryPy to Kid
  • Summary changed from Add variables to template root, not just in tg. namespace to [PATCH] Add variables to template root, not just in tg. namespace

please take a look at this I think it can be added on 1.0b2 if it doesn't breaks anything

comment:2 Changed 11 years ago by alberto

  • Status changed from new to closed
  • Resolution set to fixed

Comitted at [2261]. Thanks! :)

Alberto

comment:3 Changed 11 years ago by alberto

BTW. I've renamed global_variable_providers to root_variable_provides to avoid confusion with the variables at globals()

Note: See TracTickets for help on using tickets.