-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I have HTML stored within my Interbase tables which I access as <dtml-var description> I just tried storing within that HTML, a reference to a dtml method, but it does not display. Is that because this is considered dtml within dtml? Should we have another tag such as <dtml-code variable> where the text retrieved by variable also gets interpreted? - -- Regards, Graham Chiu gchiu<at>compkarori.co.nz http://www.compkarori.com/dynamo - The Homebuilt Dynamo http://www.compkarori.com/dbase - The dBase bulletin -----BEGIN PGP SIGNATURE----- Version: PGPsdk version 1.7.1 iQA/AwUBOO8BxbTRdIWzaLpMEQL+TQCg7adqlgUFGeC6G0wlIxcZLHY+svkAoIK+ dBCu8T/vwpt83dmunG17OFOy =np3S -----END PGP SIGNATURE-----
Graham Chiu wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I have HTML stored within my Interbase tables which I access as
<dtml-var description>
I just tried storing within that HTML, a reference to a dtml method, but it does not display.
Is that because this is considered dtml within dtml?
Sort of, the DTML engine does not evaluate code in what it basicly considers a 'string'.
Should we have another tag such as
<dtml-code variable>
where the text retrieved by variable also gets interpreted?
Uhm... I don't know. What you want to turn your string into is an object that can evaluate DTML code, then you can call it from another tag such as var or call or in. This cannot be done from DTML, you need to drop to python to do this. Just instanciate a 'temporary' DTML object (proabably a method), feed it your string, and then call it. This could probably be done easily from an external method: <dtml-var "anExternalMethod("<dtml-var blah>")"> -Michel -Michel
On Sun, 9 Apr 2000, Graham Chiu wrote:
I have HTML stored within my Interbase tables which I access as
<dtml-var description>
I just tried storing within that HTML, a reference to a dtml method, but it does not display.
In what way it didn't display? Oleg. (All opinions are mine and not of my employer) ---- Oleg Broytmann Foundation for Effective Policies phd@phd.russ.ru Programmers don't die, they just GOSUB without RETURN.
I don't know if this problem has some connection with other threads running now, but I don't understand when the text is html_quoted or not ? I've such a behaviour with Zclass method. If I call it : <dtml-var "myinstance.method"> the text is html_quoted. If I call it : <dtml-with myinstance> <dtml-var method> </dtml-with> the text is not html_quoted and so, there's no problem. I've seen in a previous message : ------<abstract>----------------------------------------- Subject: Re: [Zope] text type Date: Sat, 8 Apr 2000 16:32:01 -0400 (EDT) From: "R. David Murray" <bitz@bitdance.com> In any case, I suspect that <dtml-with Object> <dtml-var property> </dtml-with> will print what you expect. (The quotes required to get Object.property to work change the rules about how an object is interpreted: inside the quotes you are operating in Python rather than DTML). ------</abstract>-------------------------------------- It could be the beginning of an answer. But why Python would html_quote a string and dtml wouldn't ? Is there a solution but playing with <dtml-with> ? Thanks -- Denis Frère P3B : Club Free-Pytho-Linuxien Carolorégien http://www.carolo.net
On Mon, 10 Apr 2000, Denis [iso-8859-1] Fr�re wrote:
It could be the beginning of an answer. But why Python would html_quote a string and dtml wouldn't ?
Is there a solution but playing with <dtml-with> ?
DTML does a call of the object (ie: it invokes the object's __call__ method). The Python expression "folder.method" results (by python rules) in a call to the object's __str__ method, which prints out, by python convention, some printable "representation" of the object. In the case of a DTML method, that would be the DTML source, and I guess it's URL quoted becuase the author of the __str__ method figured a web page was the most likely context in which the str method would get called, and quoting it would mean the source would get displayed as originally entered when viewed in a browser (but I'm guessing here; there could be something I haven't learned about this part of the machinery!) You can achieve the same effect as the dtml-with inside the python expression by explicitly calling the object ("folder.method()"). Some of the other magic that dtml does on a call, though, is to pass the 'client' and 'namespace' in to the called object as the first two arguments. So to produce the same effect as the dtml-with, you have to do: <dtml-var "folder.method(_.None,_)"> _.None is passing a null client, and _ is the dtml name space stack. This is neither intuitive nor particularly pretty. DC folks have explained that the initial design of Zope never forsaw the exposure of the Python within the DTML, and thus things are not as clear and clean as one would ideally like. I believe there may be some discussion in the interfaces wiki about how to improve this. --RDM
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In article <Pine.LNX.4.21.0004091624470.13883-100000@fep132.fep.ru>, Oleg Broytmann <phd@phd.russ.ru> writes
On Sun, 9 Apr 2000, Graham Chiu wrote:
I have HTML stored within my Interbase tables which I access as
<dtml-var description>
I just tried storing within that HTML, a reference to a dtml method, but it does not display.
In what way it didn't display?
Michel said that Zope just passes strings straight thru, but that's not what happened. I would have thought that I should have seen the dtml display as text, but instead, it was just blank suggesting Zope was doing something to it. - -- Regards, Graham Chiu gchiu<at>compkarori.co.nz http://www.compkarori.com/dynamo - The Homebuilt Dynamo http://www.compkarori.com/dbase - The dBase bulletin -----BEGIN PGP SIGNATURE----- Version: PGPsdk version 1.7.1 iQA/AwUBOPDuOLTRdIWzaLpMEQKtEACfTRJhMvss5OyEj0wUUFd2EGQ9vQMAmgMN IRhft2fEFp6FgcW1auiydiki =WchI -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In article <cE0sd0AnjY84EwaM@compkarori.com>, Graham Chiu <anon_emouse@hotmail.com> writes
display as text, but instead, it was just blank suggesting Zope was doing something to it.
Oops, just checked the HTML source as suggested, and it's there. So the display is being suppressed by the browser and Zope is passing it thru unchanged. - -- Regards, Graham Chiu gchiu<at>compkarori.co.nz -----BEGIN PGP SIGNATURE----- Version: PGPsdk version 1.7.1 iQA/AwUBOPEE37TRdIWzaLpMEQI6zwCfWtI0v6ytfGxw49ZX1qCwt3tjXz8AnRh1 keDmyWTtm+H115O0W8ny3sVs =h9aW -----END PGP SIGNATURE-----
On Mon, 10 Apr 2000, Graham Chiu wrote:
Oops, just checked the HTML source as suggested, and it's there. So the display is being suppressed by the browser and Zope is passing it thru unchanged.
But of course. Browser recognized <...> construct as unrecognizeable tag :) That's what I suspected from the very beginning :) Now - try eveluating the HTML as DTML. Oleg. ---- Oleg Broytmann http://members.xoom.com/phd2.1/ phd2@earthling.net Programmers don't die, they just GOSUB without RETURN.
participants (5)
-
Denis Frère -
Graham Chiu -
Michel Pelletier -
Oleg Broytmann -
R. David Murray