That's true, the expression <img alt="..." src="..."> is plain HTML, but in my case if you write the following thing in a DTML document: <img src="name_of_a_python_script"> the browser doesn't call the python script to display the image. How can I put this problem right? Many thanks, Tibo.
Obviously, something like: <dtml-var data_of_the_jpeg_file> doesn't dsiplay an image but the content of the jpeg file, so do you know how to fix this problem?
This is an interesting request. Almost certainly, you do not want to do this, but if you do, you will want to
... 3) create a python script that returns the image:
if REQUEST['SESSION'].has_key('jpg_image'): img = REQUEST.SESSION.jpg_image else: img = container.substitute_image.data
return img
4) call the method from an img tag: <img alt="my image stored in a session" src="python_script_name" /> Note that you'll have to calculate height and width on your own...
You're right -- that's not how it's done in DTML. But pay attention to what's going on in the example anyway. That's not a templating language of any sort: it's plain HTML. It's making the Python Script the 'src' attribute of an 'img' tag. The browser will retrieve and display it. --jcc __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com
Actually, if you get the url_of_the_python_script in the src attribute of the img element, then the browser (if it is a graphical browser) will call the python script. <img src="/url/of/my/script" alt="my image in session object" /> Troy
participants (2)
-
clebert thibault -
Troy Farrell