[Zope] From DTML to ZPT i need help

Andreas Jung lists at zopyx.com
Fri Sep 28 11:33:37 EDT 2007



--On 28. September 2007 15:55:29 +0100 kamal hamzat 
<hamzat at dnetsystems.net> wrote:

> I have been having issue converting this code in DTML to ZPT.
>
>
> <dtml-in "news.zCatNewsCurrent()">
> <dtml-let article=absolute_url>
> <dtml-if expr="_.int(article[46:48]) < 5">
>             <div> <a href="<dtml-var expr="article[0:48]">" class="link3">
>                  <dtml-var title>
>
>   </a><dtml-var author> <br>
>
>             <font class="text1"> <dtml-var summary> </font> &nbsp;
>                   <a href="<dtml-var expr="article[:48]">" class="link5">
>                    details
>                   </a>
>              <br><br>
>               </div>
>
> </dtml-if>
> </dtml-let>
> </dtml-in>
>

This code is too ugly in order to think about a proper migration.
You write a python script that prepares the data to rendered. You can
the script from the ZPT and iterate over the results using tal:repeat.
tal:content is your friend for rendering dynamic content...but
you should really read the three ZPT chapters of "The  Zope Book"
before starting in order to understand what you can do with ZPT.

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20070928/23d8d6a4/attachment.bin


More information about the Zope mailing list