[Zope] From DTML to ZPT i need help

Andrew Milton akm at theinternet.com.au
Fri Sep 28 11:01:06 EDT 2007


+-------[ kamal hamzat ]----------------------
| 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>
| Can somebody help to jump start me by converting this code to ZPT for me?
|  
| I will be most grateful.
|  
| Thanks.
| Kamal

Try this as a starting point, not guaranteed to be pretty or correct.

<div tal:repeat="item news/zCatNewsCurrent" tal:define="article item/absolute-url">

  <div tal:condition="python:int(artcle[46:48]) < 5">
    <a tal:attributes="href python:article[0:48]" class="link3" tal:content="item/title"> </a>
    <br tal:replace="string: ${item/author}" /><br>
    <font class="text1" tal:content="item/summary"></font>&nbsp;
    <a tal:attributes="href python:article[:48]" class="link5">details</a>
    <br><br>
  </div>
</div>
  

-- 
Andrew Milton
akm at theinternet.com.au


More information about the Zope mailing list