On Wednesday 04 April 2007 14:23, Disrupt07 wrote:
> I have defined a widget as follows:
>
>
> class TopLink(Widget):
> params = [myparam]
> params_doc = { 'myparam': 'bla bla bla' }
> template = 'project.templates.template1'
> retrieve_css = set_with_self
> top_link = TopLink()
>
>
> Now I want my index.kid template to call this widget.
>
> 1. How can I call it from within the index.kid template?
As you do it with all other widgets - return it in the controller method, and
invoke
${widget.display()}
in the template.
> 2. I need to populate the parameter myparam with data. Shall I do it
> in the widget code, or in the controller?
I don't understand that question. myparam is a constrution time parameter.
Neither controller nor widget code come into play.
You can pass a callable if you want it to be evaluated each rendering. And you
can pass parameters to the widget as well in the .display()-method.
Diez
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---