[ZPT] Formatting strings and more motivation needed

Peter Bengtsson mail@peterbe.com
Mon, 7 May 2001 16:14:56 +0200


1st Q.

Maybe I'm blind or again lazy but I havent yet found out how to string
formatting.

The old DTML way...

<dtml-var birthday fmt="%A %d/%m - %Y">
or
<dtml-var "bobobase_modification_time().strftime('%A %d/%m - %Y')">
or
<dtml-var price thousands_commas>

Here is one way of doing: <h3><dtml-var document_title capitalize></h3>
    <h3 tal:define="title template/title"
        tal:content="python:modules['string'].capitalize(title)">Title
Capitalized</h3>
(pretty lengthy)

---------------------------------
2nd Q.

I'm loosing my motivation on ZPT :(.
One cool thing I like about ZPT is the "The ambiguities caused by DTML's
implicit namespace stack are absent." -- Jim @ IPC9
In the same presentation by Jim one of the first screens is reminding us
that DTML isn't too bad, but "is getting old".
http://www.zope.org/Members/jim/Info/IPC9/PresentationTemplates
The next step is saying how good ZPT is for use with Golive and WebDAV and
non-zope web designers (I.e. "loosers" :). Also clearly mentioned in Ethans
excellent
http://www.zope.org/Wikis/DevSite/Projects/ZPT/IntroductionForDTMLers

My question is: Why should me and my company choose to convert over to ZPT
rather than staying in well supported DTML? And what else is clearly better
with ZPT/TAL/TALES compared to DTML?
Considering that we never use Golive or Dreamweaver and that our Zope-zen is
good enough to be able to control all the namespace-in-one-pot-stuff.
(note the above pre-consideration is false, but what _if_ it was true)

I have read the WebSiteCreationStory
(http://www.zope.org/Wikis/DevSite/Projects/ZPT/WebSiteCreationStory) but I
need more!