Donald Ball wrote:
>> What I do here is using Kid's "fragment" option and then using
>> innerHTML on the JavaScript side.
>>
>> Something like:
>>
>> @turbogears.expose(fragment = True, html =
>> 'marketwatch.templates.some_example') def
>> fragment_returning_method(self, *args, **kwargs): return
>> dict(form = my_form)
>
> that's a good solution. two questions occur. one, is there a way to
> choose to fragment dynamically? tg_fragment in the returned dict has
> no effect. also, is there a way to access the fragment datum from the
> kid template, so that i could use py:if and py:strip to inhibit chunks
> of the page if it's being rendered as a fragment?
I usually couple the innerHTML/fragment solution with widgets. Each
fragment is generated by a widget, and then in my regular templates
that are generating full pages, I use these widgets to insert the
fragments into the page itself.
You can see this approach in the Fast Track source:
http://cleverdevil.org/fasttrack
Best of luck!
--
Jonathan LaCour
http://cleverdevil.org
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---