Populating selection-style property with list of folders
Hi - Perhaps someone can help ... What dtml method produces a list of folders that is compatible with the 'selection' property type? My goal is to add a proprty to the ZMI property sheet for a folder that is a drop-down listing of available subfolders. I have no problem creating a property called ThemeFolder of type 'selection' that points to another property called FolderList of type 'lines' that has the names of the folders. The documentation says the selection can come from either a property or a method. When the selection property it is pointed to a DTML Method called DTMLFolderList with the code: _dtml-in "objectValues(['Folder'])"_ _dtml-var id_ _/dtml-in_ It reports an error. I have tried _dtml-var objectItems_ and several other variations with similar results. What dtml method produces a list that is compatible with the 'selection' property type? I'm stumped. Thank you for any assistance you can provide or point me to expanded documentation! A full surch of the mailing list archives didn't report any suggestions. Thank you, Gary
From: "Gary Duke Speer" <zope@cortech.org>
What dtml method produces a list of folders that is compatible with the 'selection' property type?
My goal is to add a proprty to the ZMI property sheet for a folder that is a drop-down listing of available subfolders.
I have no problem creating a property called ThemeFolder of type 'selection' that points to another property called FolderList of type 'lines' that has the names of the folders.
The documentation says the selection can come from either a property or a method.
When the selection property it is pointed to a DTML Method called DTMLFolderList with the code: _dtml-in "objectValues(['Folder'])"_ _dtml-var id_ _/dtml-in_
It reports an error. I have tried _dtml-var objectItems_ and several other variations with similar results. What dtml method produces a list that is compatible with the 'selection' property type?
I am not quite sure what you are trying to accomplish... (1) create a form with a drop-down list of folders that are contained within the current folder: <form> <select name="xxx"> <dtml-in "objectValues('Folder')"> <option value="<dtml-var id>"> <dtml-var id> </dtml-in> </select> </form> (2) create a property field on the current folder which contains a list of the subfolders contained within the folder <dtml-call "REQUEST.set('flist', [])"> <dtml-in "objectValues('Folder')"> <dtml-call "flist.append(id)"> </dtml-in> <dtml-call "manage_addProperty('ThemeFolder', flist, 'lines')"> (3) display a drop-down list which contains the contents of a property field of a folder (the property field has previously been created and contains a list of the subfolders - see item 2 above) <form> <select name="xxx"> <dtml-in "getProperty('ThemeFolder')"> <option value="<dtml-var sequence-item>"> <dtml-var sequence-item> </dtml-in> </select> </form> (4) something else? Jonathan
participants (2)
-
Gary Duke Speer -
Jonathan Hobbs