It's totally acceptable to create the widget anywhere, and import it
into master.html in a python block.

It's all "view" logic so there's no reason not to do it in the
template.   And you can use TW widgets any time you want in TG2 -- the
limitation that you couldn't import them in the template  in tg1 is
removed because in tg2 the resource injection happens after the
template is rendered.

--Mark Ramm

On Nov 27, 6:59 pm, Radityo <[EMAIL PROTECTED]> wrote:
> I am trying to make a website using  tg2b and currently I tried to
> create a web menu system using toscawidgets.
> But there are something that I cannot understand:
> 1. How to include a widget on every request without having to pass it
> through tmpl.context on every method in every controller? I could do
> in-line code without toscawidgets in master template, but some how it
> doesn't feel right.
> 2. I 
> triedhttp://www.turbogears.org/2.0/docs/main/ToscaWidgets/Cookbook/Dynamic...,
> but sometimes it return empty list.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to