Render DTML without having it in a Zope object
Hello everyone, I have some HTML/DTML saved in the database and I want to now display it. But before I display, I need to render the DTML that is contained in the text. Can anyone lead my in the right direction; maybe by telling me which file handles the rendering and I can read some source code. But of course, it would be cool, if I could get a more explained response. BTW, I can call the method to render the text from Python or DTML. I really don't care. Thanks in advance!!! Regards, Stephan -- Stephan Richter CBU - Physics and Chemistry Student Web2k - Web Design/Development & Technical Project Management
I have some HTML/DTML saved in the database and I want to now display it.
What database - something different then data.fs probably?
But before I display, I need to render the DTML that is contained in the text. Can anyone lead my in the right direction; maybe by telling me which file handles the rendering and I can read some source code. But of course, it would be cool, if I could get a more explained response. BTW, I can call the method to render the text from Python or DTML. I really don't care.
You'd have to feed it to <zopehome>/lib/python/DocumentTemplate/DT_HTML.py and use the String method, probably. It is not completely clear to me what you try to do. Is it indirect dtml calling - this could be difficult (your best bet would be to use an external method methinks). If not, why can't you include it like any normal DTML Method? HTH (if only slightly) Rik
You'd have to feed it to <zopehome>/lib/python/DocumentTemplate/DT_HTML.py and use the String method, probably. It is not completely clear to me what you try to do. Is it indirect dtml calling - this could be difficult (your best bet would be to use an external method methinks). If not, why can't you include it like any normal DTML Method?
How are you Rik, Yeah, I will try the method in DT_HTML.py. Well I am writing an online testing tool where the professor can enter some question for some numerical problem. They are able to refer to a couple of variables when writing the questions which are saved in a DB. Since I wrote my own Python Products, it should be no problem to implement the appropriate methods in my code. Thanks for your help. Regards, Stephan -- Stephan Richter CBU - Physics and Chemistry Student Web2k - Web Design/Development & Technical Project Management
hi stephan, one project i am working on right now does something similar, retrieving data for business objects out of an RDBMS and rendering it through zope without instantiating e.g. an instance of a product representing the business object. in my case it is handled with external methods (not the external method included with zope, but it'll work either way). you create an external method that accepts whatever parameters you need to call into the database and you return the record(s) out of it. you can do a lot of nifty and simple stuff in the external method to control exactly what is being passed back, what i am doing is creating an empty dictionary in the external method and just add whatever i want on the page into that dictionary. in your page you could then do the following: <dtml-call expr="REQUEST.set('result_dict', Path.To.Method(param, param2, ...))"> here is value 1: <dtml-var name="result_dict['value1']"> iterating over a list that is part of the result dictionary: <dtml-in name="result_dict['list_component']"> <dtml-var name="variable_from_list"> </dtml-in> HTH jens on 9/8/00 1:33, Stephan Richter at srichter@cbu.edu wrote:
Hello everyone,
I have some HTML/DTML saved in the database and I want to now display it. But before I display, I need to render the DTML that is contained in the text. Can anyone lead my in the right direction; maybe by telling me which file handles the rendering and I can read some source code. But of course, it would be cool, if I could get a more explained response. BTW, I can call the method to render the text from Python or DTML. I really don't care.
Thanks in advance!!!
Regards, Stephan -- Stephan Richter CBU - Physics and Chemistry Student Web2k - Web Design/Development & Technical Project Management
participants (3)
-
Jens Vagelpohl -
Rik Hoekstra -
Stephan Richter