News for hackers. Stuff that matters.
Re:Simplify templating with node.js, jsdom 0.2.0 and weld by tmpvar on Saturday February 19, 2011 @01:26AM (#2238594)
How do you rationalize including logic in the markup?
Re:Simplify templating with node.js, jsdom 0.2.0 and weld by simonw on Saturday February 19, 2011 @03:04AM (#2238710)
Presentation logic requires logic. If a designer decides to display a bunch of items as three columns rather than two columns, or to switch the display for a single item vs a number of different items, that's presentation logic. Ideally it should go in the template, if that's where you've chosen to keep it.

With Django, I often find myself writing view logic to support specific presentation tasks (regrouping items in a manner more complicated than Django's {% regroup %} template tag allows, for example). This used to bother me, but then I decided that pragmatism beats purity if you actually want to ship anything.