dtml-tree advice, please
Consider the following situation: --------------------------------- I have two ZClasses. One ("Album") is folderish, and serves as a photo album. The other ("Photo") isn't and serves as a photo in an Album. Albums can contain only Albums and Photos. I would like to have a dtml-tree represent this hierarchy of Albums and Photos. The Question: ------------- should I use <dtml-tree branches_expr="objectValues('Album')" .. <dtml-tree branches=objectValues .. <dtml-tree branches=tpValues .. <dtml-tree ??? Things to consider: ------------------- I need the branches to represent two different meta types, Album and Photo. If I use branches_expr="objectValues('Album') I'll see the tree rendered with only Albums, and no Photos shown. If I use branches=objectValues then I'll see EVERYTHING in the current folder and, at the top level, peer to the root of any Album hierarchy, there may be other objects like dtml documents, methods, etc. I don't want to see those. If I use branches=tpValues (..still learning this one..) I'll see any object (?) in the current folder (?). This seems to work best in experiment, but what if I were to define and instantiate some unrelated ZClass and happen to have one in the current folder with an Album. I tend to think that it would be rendered in my dtml-tree with the Albums and Photos.. ..If anyone can recommend a source of documentation (be specific, no RTFM's please) that would help me solve this myself, that, too, would be welcome. ------------ Brian Withun
Brian Withun wrote:
I need the branches to represent two different meta types, Album and Photo. If I use branches_expr="objectValues('Album') I'll see the tree rendered with only Albums, and no Photos shown.
Not sure of the consequences in the tree tag. But objectValues() accepts multiple arguments. Try: branches_expr="objectValues('Album' 'Photo') HTH, -- Tim Cook -- Cook Information Systems | Office: (901) 884-4126 8am-5pm CDT * It's easy to stop making mistakes. Just stop having ideas. * FreePM Project Coordinator http://www.freepm.org OSHCA Founding Supporter http://www.oshca.org
Seb Bacon wrote:
<branches_expr="objectValues('Album' 'Photo')>
I think you mean
<branches_expr="objectValues(['Album','Photo'])>
Ah, what's a bracket here or there? <g> It may be more correct? But <dtml-in "objectValues('DTML Method' 'Folder')"> will render as expected. Go figure! -- Tim Cook -- Cook Information Systems | Office: (901) 884-4126 8am-5pm CDT * It's easy to stop making mistakes. Just stop having ideas. * FreePM Project Coordinator http://www.freepm.org OSHCA Founding Supporter http://www.oshca.org
participants (3)
-
Brian Withun -
Seb Bacon -
Tim Cook