.. title: KID to Genshi migration .. slug: KID_to_Genshi_migration .. date: 2009-01-07T15:22:50 .. tags: TurboGears .. category: .. link: .. description: TurboGears .. type: Migrating this blog from KID to Genshi seems to have been easy enough. To change a KID template into a Genshi format, all you have to do is: 1. in all templates except SiteTemplate replace: :: with: :: 2. Add: :: to every template file except SiteTemplate.html . 3. In SiteTemplate, change: :: to: :: 4. wrap all turbogears widget calls in ET(), for example: :: ${ET(form.display(value=entry, submit_text=_(u'Publish'), action=tg.url('/add_article'), form_attrs=dict(id='articleform'), tags=tags))} And that's it. Hopefully, this concludes the mind-numbing template translations for now. Next step: using ngettext() for things like "There are N Comments for this article". .. TEASER_END Migrating this blog from KID to Genshi seems to have been easy enough. To change a KID template into a Genshi format, all you have to do is: 1. in all templates except SiteTemplate replace: :: with: :: 2. Add: :: to every template file except SiteTemplate.html . 3. In SiteTemplate, change: :: to: :: 4. wrap all turbogears widget calls in ET(), for example: :: ${ET(form.display(value=entry, submit_text=_(u'Publish'), action=tg.url('/add_article'), form_attrs=dict(id='articleform'), tags=tags))} And that's it. Hopefully, this concludes the mind-numbing template translations for now. Next step: using ngettext() for things like "There are N Comments for this article".