SV: [Zope] ZPT: ready for prime time?
<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>
You're joking right? They're both horrible :-(
I'm sure the second one could be made nicer with a bit mroe PythonScript usage, if not then I'll stick with DTML, and I'm sure people here can remember how much I like DTML ;-)
Well, if you don't need the template to look good in Dreamweaver or something, you can get it down to something like this; <table boder="0"> <tr tal:repeat="tab tabList"> <td align="center" tal:attributes="background python:test(repeat.tab.index == here.REQUEST.activeTab, 'frontTab.gif', 'backTab.gif')"> <a tal:attributes="href tab/target" tal:content="tab/label" /></td> </tr> </table> I am waiting for the day when ZPT is default and DTML only is in Zope for compatibility with older versions... I for sure will never use DTML again. /Magnus
Thank you all for your valuable comments! Dieter
Today we actually dumped a few ZPT objects and rewrote them in DTML. It became a bit more difficult when the template objects were called from a more complex structure. We had to use the "options" namespace and things started to not work. Now we don't have time to dig into it further. Peter Was that what you wanted to hear?
Thank you all for your valuable comments!
Dieter
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Dieter Maurer -
Magnus Heino (Rivermen) -
Peter Bengtsson