I'm working through an example in the Zope Book and I want to display a random image inside the folder 'images'. But instead of a picture I get the source with all the tags escaped. I have this Python script named 'randomImage': ------------------------------------ import random return random.choice(context.objectValues('Image')) ------------------------------------ I have this body in a ZPT named 'use_randomImage': ------------------------------------ <body> <span tal:replace="here/images/randomImage">image</span> </body> ------------------------------------ And I get this generated source w escaped tags (body) when I call the ZPT: ------------------------------------ <body> <img src="http://www.mycomputer.local/images/deck_mika.gif" alt="deck_mika.gif" title="deck_mika.gif" height="142" width="35" border="0" /> </body> ------------------------------------ of course I want the image instead of escaped html ... any ideas what I'm doing wrong? thanks! 'K:? -- Kai Vermehr | eBoy http://www.eboy.com
Kai Vermehr wrote:
I have this body in a ZPT named 'use_randomImage': ------------------------------------ <body> <span tal:replace="here/images/randomImage">image</span> </body> ------------------------------------
Use the structure keyword: <body> <span tal:replace="structure here/images/randomImage">image</span> </body> regards Max M
On Thu, Nov 06, 2003 at 01:26:50PM +0100, Max M wrote:
Kai Vermehr wrote:
I have this body in a ZPT named 'use_randomImage': ------------------------------------ <body> <span tal:replace="here/images/randomImage">image</span> </body> ------------------------------------
Use the structure keyword:
<body> <span tal:replace="structure here/images/randomImage">image</span> </body>
Max is right. Where in the zope book, and what version of the zope book, did you find this example? It should be fixed. -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's THE INEFFICIENCY! (random hero from isometric.spaceninja.com)
the (wrong) example is here: Advanced Zope Scripting / Using Python based scripts / Doing Math page 235 on the pdf I have ... also there's a wrong slash at the end: <span tal:replace="here/Images/randomImage"/> Is there a standard way to report this kind of things? The pdf I have is difficult to use because it does not tell you in which chapter you are on top of the page. You always have to go back some pages to find the chapter. I'm not really sure if it is an "official" pdf. But there should be one ... -- Kai Vermehr | eBoy http://www.eboy.com On 06.11.2003, at 17:27, Paul Winkler wrote:
On Thu, Nov 06, 2003 at 01:26:50PM +0100, Max M wrote:
Kai Vermehr wrote:
I have this body in a ZPT named 'use_randomImage': ------------------------------------ <body> <span tal:replace="here/images/randomImage">image</span> </body> ------------------------------------
Use the structure keyword:
<body> <span tal:replace="structure here/images/randomImage">image</span> </body>
Max is right. Where in the zope book, and what version of the zope book, did you find this example? It should be fixed.
--
Paul Winkler http://www.slinkp.com Look! Up in the sky! It's THE INEFFICIENCY! (random hero from isometric.spaceninja.com)
_______________________________________________ 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 )
participants (3)
-
Kai Vermehr -
Max M -
Paul Winkler