One idea is to add the stuff you need to the
turbogears.view.variable_providers so that the variables you need are
exposed to every kid template.
so you would have something like:
def set_user_name(dict_obj):
dict_obj['user_name'] = identity.current.user.user_name
turbogears.view.variable_providers.append(set_user_name)
Now, ${tg.user_name} is automatically usable in all kid templates.
identity.current is already included in the standard kid variables (as
identity). So, you should already be able to do
${tg.identity.user_name} wherever you want. But, the
variable_providers information is still applicable for variables you
want to include on every page.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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
-~----------~----~----~----~------~----~------~--~---