including a dtml method through a variable
With reference to the usual dtml-var to include a dtml-method in another page. i.e. <dtml-var page_dtml_widget> How is it possible to do this dynamically? Lets say in some pyhton script i execute a line like this: if a: REQUEST.set("widget", "page_dtml_widget1") else: REQUEST.set("widget", "page_dtml_widget2") Later on in the dtml method, how can i use that variable for a dynamic include? <dtml-var widget>... ...Obviously doesnt work, it just prints out the value of the variable. After much head scratching i still cant get around this. Any suggestions anyone?
On Mon, 2003-10-13 at 15:28, Declan Shanaghy wrote:
With reference to the usual dtml-var to include a dtml-method in another page. i.e.
<dtml-var page_dtml_widget>
How is it possible to do this dynamically? Lets say in some pyhton script i execute a line like this:
if a: REQUEST.set("widget", "page_dtml_widget1") else: REQUEST.set("widget", "page_dtml_widget2")
Later on in the dtml method, how can i use that variable for a dynamic include?
<dtml-var widget>... ...Obviously doesnt work, it just prints out the value of the variable. After much head scratching i still cant get around this. Any suggestions anyone?
How about (untested) ------- <dtml-if some_condition> <dtml-call "REQUEST.set('my_meth', 'meth_name1')"> <dtml-else> <dtml-call "REQUEST.set('my_meth', 'meth_name2')"> </dtml-if> <dtml-var "_[my_meth]"> ------- HTH, Dylan
I think you want: <dtml-var "_['widget']"> Rick Declan Shanaghy wrote:
With reference to the usual dtml-var to include a dtml-method in another page. i.e.
<dtml-var page_dtml_widget>
How is it possible to do this dynamically? Lets say in some pyhton script i execute a line like this:
if a: REQUEST.set("widget", "page_dtml_widget1") else: REQUEST.set("widget", "page_dtml_widget2")
Later on in the dtml method, how can i use that variable for a dynamic include?
<dtml-var widget>... ...Obviously doesnt work, it just prints out the value of the variable. After much head scratching i still cant get around this. Any suggestions anyone?
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
D. Rick Anderson -
Declan Shanaghy -
Dylan Reinhardt