Re: [Zope] From DTML to ZPT i need help

2007-09-28 Thread Andreas Jung



--On 28. September 2007 15:55:29 +0100 kamal hamzat 
[EMAIL PROTECTED] 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

  /adtml-var author br

font class=text1 dtml-var summary /font nbsp;
  a href=dtml-var expr=article[:48] class=link5
   details
  /a
 brbr
  /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


pgpFSO7RGmfAL.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] From DTML to ZPT i need help

2007-09-28 Thread Andrew Milton
+---[ 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
| 
|   /adtml-var author br
| 
| font class=text1 dtml-var summary /font nbsp;
|   a href=dtml-var expr=article[:48] class=link5
|details
|   /a  
|  brbr   
|   /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/fontnbsp;
a tal:attributes=href python:article[:48] class=link5details/a
brbr
  /div
/div
  

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] From DTML to ZPT i need help

2007-09-28 Thread 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
 
  /adtml-var author br
 
font class=text1 dtml-var summary /font nbsp; 
  a href=dtml-var expr=article[:48] class=link5 
   details
  /a  
 brbr   
  /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___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] From DTML to ZPT i need help

2007-09-28 Thread Dieter Maurer
Andrew Milton wrote at 2007-9-29 01:01 +1000:
 ...
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

Be careful: tal:define is evaluated before tal:repeat (independent
of the textual appearance as attribute).



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] From DTML to ZPT i need help

2007-09-28 Thread Andrew Milton
+---[ Dieter Maurer ]--
| Andrew Milton wrote at 2007-9-29 01:01 +1000:
|  ...
| 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
| 
| Be careful: tal:define is evaluated before tal:repeat (independent
| of the textual appearance as attribute).

But if I just did all his homework for him, he'd never learn anything.

-- 
Andrew Milton
[EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )