RE: [Zope] getting <!-- --> sections to 'render' from an external method...
I want the <!--#var conference--> DTML to be left alone by the make_html external method so that Zope can get given it and then do all its good stuff.
Thanks for the reply,
Um, I don't know if I understand it quite right.
If the question was concerning what the method should return, then you could either pass 'REQUEST' or 'self' (Depending on where the conference variable is:in REQUEST, in a Folder) to you method and have it return something like
'For the following exercise, use the conferencing system. %s' %REQUEST['conference'], tagtype='text'
Would this allow Zope to 'render' the returned value from the external method (eg '...use the conferencing system <!--#var conference--> ...') so that the #var is expanded?
If the question was concerning the way to pass a variable to an external method, then the problem is that you can't use DTML inside an expression. Change it to something like: 'For the following exercise, use the conferencing system. %s' %conference, tagtype='text'
I see what you mean. I don't want to pass a variable to the external method, I want the external method to put a 'wrapper' around the content I send it (in this case HTML) and then pass that back to the Zope system which will then do any further substitutions/acquisitions etc. based upon any DTML that *may* be returned. Thanks tone ------ Dr Tony McDonald, FMCC, Networked Learning Environments Project The Medical School, Newcastle University Tel: +44 191 222 5888 Fingerprint: 3450 876D FA41 B926 D3DD F8C3 F2D0 C3B9 8B38 18A2
-----Original Message----- From: Tony McDonald [mailto:tony.mcdonald@ncl.ac.uk] Sent: vrijdag 21 mei 1999 11:34 To: hoekstra@fsw.LeidenUniv.nl; Zope@zope.org Subject: RE: [Zope] getting <!-- --> sections to 'render' from an externalmethod...
I want the <!--#var conference--> DTML to be left alone by the make_html external method so that Zope can get given it and then do all its good stuff.
Thanks for the reply,
Um, I don't know if I understand it quite right.
If the question was concerning what the method should return, then you could either pass 'REQUEST' or 'self' (Depending on where the conference variable is:in REQUEST, in a Folder) to you method and have it return something like
'For the following exercise, use the conferencing system. %s' %REQUEST['conference'], tagtype='text'
Would this allow Zope to 'render' the returned value from the external method (eg '...use the conferencing system <!--#var conference--> ...') so that the #var is expanded?
Yes, (though you perhaps it depends on how you call a variable - it does in DTML, don't know about External Methods)
If the question was concerning the way to pass a variable to an external method, then the problem is that you can't use DTML inside an expression. Change it to something like: 'For the following exercise, use the conferencing system. %s' %conference, tagtype='text'
I see what you mean. I don't want to pass a variable to the external method, I want the external method to put a 'wrapper' around the content I send it (in this case HTML) and then pass that back to the Zope system which will then do any further substitutions/acquisitions etc. based upon any DTML that *may* be returned.
As far as I know, External Methods and DTML methods are on the same ZOpe level, that is: they get called at the same time. The bad consequence is you can't return values from an External Method and then have them processed by Zope. The good consequence is you can do everything from an External Method that you can do from DTML (and much more). For instance you can call the DTML you would otherwise have included in the document. Rik
Tony McDonald wrote:
I see what you mean. I don't want to pass a variable to the external method, I want the external method to put a 'wrapper' around the content I send it (in this case HTML) and then pass that back to the Zope system which will then do any further substitutions/acquisitions etc. based upon any DTML that *may* be returned.
Hmm, I may be off my nut here, but I think you need to pass in the HTML/potential-DTML, do your stuff to it, then render it by calling its __call__ method. Or the other way around. Or some such. Or I could be babbling. Ross -- Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> NSBRI Research Scientist/Programmer Computer and Information Technology Institute Rice University, 6100 S. Main St., Houston, TX 77005
On Fri, 21 May 1999, Ross J. Reedstrom wrote:
Tony McDonald wrote:
I see what you mean. I don't want to pass a variable to the external method, I want the external method to put a 'wrapper' around the content I send it (in this case HTML) and then pass that back to the Zope system which will then do any further substitutions/acquisitions etc. based upon any DTML that *may* be returned.
Your external method should return a DTML method and not plain text. If you do decide to return plain text then the calling DTML should create a temporary DTML Method to process the output. for example (untested) add a DTML method with id 'temporary' in your folder and add in your external method: self.temporary.manage_edit(out,'') where out is the relevant DTML content then in your calling DTML just render the temporary DTML method like: <!--# var temporary--> Hope it works! Pavlos
participants (4)
-
Pavlos Christoforou -
Rik Hoekstra -
Ross J. Reedstrom -
Tony McDonald