Tuesday, September 11, 2007

Announcement: GenshiColumnTemplate

I've made a quickstart Genshi template for Turbogears that gives you a ready made 3 column layout, using the excellent 3 column layout from A List Apart's Holy Grail article. If you spent 5 minutes, you could do it yourself, but it's kinda nice to have something ready made. I pull out the layout css in a separate file, and relaid out the welcome page to use 3 columns. The master.html template uses Genshi's Xpath select function to pull content together into the columns.

To Install:
easy_install genshicolumntemplate

To Use:
In your templates that include master.html, make divs that have ids of 'left', 'center', 'right', 'footer', and 'header', or just add your static content to master.html. The only caveat is that there must be some sort of other element inside the positional div wrapping your text, it can't be just text, as xpath won't select it for replacement.

ToDo:
  • Documentation. It should be mercifully short, yet I still haven't done it
  • Fix up the welcome page a bit
  • Figure out some sort of decent unit test for templates
  • Wait for suggestions, criticisms, etc :)
Please let me know if you try it out.

No comments: