Christoph Zwerschke wrote:
> Diez B. Roggisch schrieb:
>   
>> I currently face the problem that I want to include jquery in *every* page 
>> we 
>> render, independent of a TW-widget that references it.
>>
>> So I wonder if there is a tg.include_widgets-like functionality available or 
>> planned that allows me to do that?
>>     

There isn't but it is very easy to implement it on a per-project basis. 
The easiest way to include the in *every* html page is to override 
BaseController in yourapp.lib.base and add this in the __call__ method 
before delegating to super:

for widget in include_widgets:
    widget.inject()

I guess that if TG2 doesn't mind to couple a little bit more with TW the 
a 'include_widgets' attribute could be added to the config and the above 
line included in TGController so users don't have to do it explicitly. 
Or perhaps it could be added to the quickstart template, or...

> You can include it directly in your master template. But I guess your
> problem is that if you use widgets that include jquery explicitly, then
> jquery will be included double. 
As long as the JSLink wrapper use is the same links are only included 
once no matter how many widgets include them or if you inject() it manually.

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

Reply via email to