[Zope] Q1: tal + image
J Cameron Cooper
jccooper at jcameroncooper.com
Tue Dec 2 15:50:24 EST 2003
fowlertrainer at anonym.hu wrote:
>My friend is say to I don't use dtml - I must use Page Template...
>
>
I would give the same advice.
>Ok, I say, and I try it.
>
>I have an logo image, named logo.
>When I use dtml, the <dtml-var logo> is working.
>
>But: when I use <p tal: replace here/logo></p>, then the zope replace
>the <> signs in image definition, and it is don't showed, only it's
>description.
>
>Why ?
>
>
TAL will automatically HTML-quote upon a 'replace' or 'content' on the
idea that you're usually displaying content that way, and want "special
characters" to be content-visible.
You may tell it otherwise with the 'structure' keyword, which indicates
that you're using data that should be written verbatim since it may have
HTML structure to it::
<span tal:replace="structure here/logo" />
Your syntax above was quite broken, by the way. I'm assuming it's not
what you actually tried to use.
>And why I feel that tal is known less than dtml ?
>
>
Dunno. Maybe because DTML is older, or because it's more like all the
other simple template languages? Still, most modern Zope projects use ZPT.
--jcc
--
"Code generators follow the 80/20 rule. They solve most of the problems, but not all of the problems. There are always features and edge cases that will need hand-coding. Even if code generation could build 100 percent of the application, there will still be an endless supply of boring meetings about feature design."
(http://www.devx.com/java/editorial/15511)
More information about the Zope
mailing list