Hey all, Am i just missing something simple here? I want to keep certain DTML Methods in a common folder so they can be used from anywhere. I have: TestFolder index_html Util utility_function Now my confusion. Within TestFolder.index_html, I'd like to be able to: <dtml-var "Util.utility_function"> but this returns unrendered content of utility_function. I can <dtml-with Util><dtml-var utility_function></dtml-with> but I hate <dtml-with> ... and I can also <dtml-var "Util.utility_function(REQUEST=REQUEST)"> but that is also a little long-winded. Comments? Advice? Thanks ... -- John Ziniti Channing Laboratory Brigham and Women's Hospital 181 Longwood Avenue Brookline, MA 02115 john.ziniti@channing.harvard.edu
On Fri, 31 Aug 2001, John Ziniti wrote: JZ>Am i just missing something simple here? I want to keep certain JZ>DTML Methods in a common folder so they can be used from anywhere. JZ> JZ>I have: JZ> JZ>TestFolder JZ> index_html JZ>Util JZ> utility_function JZ> JZ>Now my confusion. Within TestFolder.index_html, I'd like to be JZ>able to: JZ> JZ><dtml-var "Util.utility_function"> JZ> JZ>but this returns unrendered content of utility_function. I can JZ> JZ><dtml-with Util><dtml-var utility_function></dtml-with> JZ> JZ>but I hate <dtml-with> ... and I can also JZ> JZ><dtml-var "Util.utility_function(REQUEST=REQUEST)"> JZ> JZ>but that is also a little long-winded. JZ> JZ>Comments? Advice? Thanks ... DTML objects are really callable instances of classess. dtml-with calls them automagically, but when you use dtml-var "..." these quotes move you from DTML to Python, and in Python there is no automagical call - you must call the objects yourself. There is no way to avoid it. Oleg. ---- Oleg Broytmann http://www.zope.org/Members/phd/ phd@phd.pp.ru Programmers don't die, they just GOSUB without RETURN.
participants (2)
-
John Ziniti -
Oleg Broytmann