dynamically generate dtml-tree urlparam attribute?
hi, i was wondering if anyone has either hacked the dtml-tree code or written a python script to create a <dtml-tree> tag with a dynamically generated urlparam attribute? i currently have a <dtml-if/elif/else> that selects from 7 prewritten <dtml-tree> tags, but i was hoping there was a better/slightly more elegant way of doing this. -jason yee
I was not able to get the 'urlparam' attribute to accept anything except a string, however all is not lost... try the following code: <dtml-call "REQUEST.set('udata', 'somevar')"> <dtml-call "REQUEST.set('dtmlcode', '<dtml-tree Folder1 urlparam='+udata+'><dtml-var id></dtml-tree>')"> <dtml-call "tst.manage_edit(dtmlcode, 'atsttitle')"> <dtml-var tst> This chunk of code overwrites a dtml method called 'tst' with a short chunk of dtml-tree code and then executes the newly written code. You will have to change 'Folder1' to whatever you are trying to use in the dtml-tree tag. And you can change the udata variable to hold whatever parameter you want to have included in your tree widget urls. HTH Jonathan ----- Original Message ----- From: "jason" <jyee+zope.2ac1dc@hellyeah.com> To: <zope@zope.org> Sent: December 10, 2003 5:33 PM Subject: [Zope] dynamically generate dtml-tree urlparam attribute?
hi,
i was wondering if anyone has either hacked the dtml-tree code or written a python script to create a <dtml-tree> tag with a dynamically generated urlparam attribute? i currently have a <dtml-if/elif/else> that selects from 7 prewritten <dtml-tree> tags, but i was hoping there was a better/slightly more elegant way of doing this.
-jason yee
_______________________________________________ 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 )
jason wrote at 2003-12-10 17:33 -0500:
i was wondering if anyone has either hacked the dtml-tree code or written a python script to create a <dtml-tree> tag with a dynamically generated urlparam attribute?
Qualified "yes" to both questions: * someone posted a patch providing an "urlparam_expr" argument for "dtml-tree" Please search the archives * I no longer use "dtml-tree" but the tree building support of the "ZTUtils" package. Examples: "Examples" subfolder of "Products/PageTemplates" or my "DocFinder" product <http://www.dieter.handshake.de/pyprojects/zope> -- Dieter
i was wondering if anyone has either hacked the dtml-tree code or written a python script to create a <dtml-tree> tag with a dynamically generated urlparam attribute?
* someone posted a patch providing an "urlparam_expr" argument for "dtml-tree" Dieter
That someone is Jonothan Farr... and the patch is now posted on his zope.org member page (http://zope.org/Members/jfarr/Patches/dtml-tree). Many thanks to Jonothan and Dieter! -jason yee
participants (3)
-
Dieter Maurer -
jason -
Small Business Services