On Tue, 2008-12-02 at 09:57 -0800, [EMAIL PROTECTED] wrote:
> 
> 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.

Oh man, that is a big improvement over the old include list in the
config file. Thanks!

Now that said, I've always thought it would be really handy to be able
to add stuff to the dictionary that goes to the template from startup
code, is that possible in TG2? ( maybe it's a dumb idea... )

Iain

> 
> --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