[Zope] dynamically generate dtml-tree urlparam attribute?

Small Business Services toolkit at magma.ca
Wed Dec 10 18:21:08 EST 2003


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 at hellyeah.com>
To: <zope at 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 at 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 )




More information about the Zope mailing list