[Zope] ZPT: ready for prime time?

infos infos@leconfortmoderne.com
Fri, 22 Jun 2001 06:54:18 +0200


---

Which implementation do you like?

<dtml-call "REQUEST.set('activeTab',REQUEST.get('activeTab',0))">
<table border="0">
<tr>
<dtml-in tabList>
<dtml-if "_['sequence-index']==activeTab">
<td align="center" width=97 height=19 background="frontTab.gif"><a
href="&dtml-target;">&dtml-label;</a></td>
<dtml-else>
<td align="center" width=97 height=19 background="backTab.gif"><a
href="&dtml-target;">&dtml-label;</a></td>
</dtml-if>
</dtml-in>
</tr>
</table>

Versus

<table border="0"
     tal:define="activeTab python:request.get('activeTab', 0)">
<tr tal:repeat="tab tabList">
<td align="center" width=97 height=19 background="frontTab.gif"
     tal:define="index repeat/tab/index"
     tal:attributes="background python:test(index==activeTab,'frontTab.gif',
'backTab.gif')">
   <a href="/" tal:attributes="href tab/target"
               tal:content="tab/label">Label</a></td>
</tr>
</table>

---

well, maybe i've worked too long with asp or maybe i'm just not good enough
using zope or maybe it's baby-perl or... i dunno what ;-)))

but i kindda like the dtml-one a bit more, and for different reasons.

1] i've had to train someone to use zope and it's easier to do it in dtml
(using cutnpaste code) (if the guy has no prog background of course)
2] its more clear to me (and using tag highligthing + indent much cleaner)
than mixin html and zpt syntax
3] i like verbose stuff, at least you can come back to a projet 6 month
later and still be able to jump right back on track

imho of course, but i'm just a newbie :-(

infos