Accsessing the folder above
Hi! I'm trying to display all folders in the folder above my product(derived from a folder) in a tree. It must be something like this: <dtml-tree branches_expr="Subfolder.objectValues(['Folder'])"> ... </dtml-tree> The problem is, that this doesn't work. I search something for "Subfolder", which includes the folder above. It works with the name of the Folder, but I want to use the product in every folder without changing it every time. Thanks Sebastian
Hi, you can use the function "aq_parent" which returns the parent-object in the aquisition path. try: <dtml-var "aq_parent.id"> and see what will be done. Regards, Dirk
Sebastian Queißer wrote:
Hi!
I'm trying to display all folders in the folder above my product(derived from a folder) in a tree. It must be something like this:
<dtml-tree branches_expr="Subfolder.objectValues(['Folder'])"> ... </dtml-tree>
The problem is, that this doesn't work. I search something for "Subfolder", which includes the folder above.
hi, <dtml-tree branches_expr="aq_parent.objectValues(['Folder'])"> cheers, maik -- Maik Jablonski __o www.zfl.uni-bielefeld.de _ \<_ Deutsche Zope User Group Bielefeld, Germany (_)/(_) www.dzug.org
First of all thanks for your help! You both gave me this method, but there's a problem, because when you use this tag, every subbranch of the aq_parent folders is the same folder, till infinte.
<dtml-tree branches_expr="aq_parent.objectValues(['Folder'])">
It worked, when I used the following tag: <dtml-tree aq_parent branches_expr="objectValues(['Folder'])"> Bye Sebastian
participants (3)
-
Dirk Datzert -
Maik Jablonski -
Sebastian Queißer