One of the most striking features of the Zope Management Interface is the navigation menu that appears on the left side. And the cool thing is, Zope comes with a built-in construct that allows you to replicate and use this tree structure for your own purposes. It's called the <dtml-tree> tag - and here's what it looks like:
<dtml-tree>
<dtml-var getId>
</dtml-tree>
This is a very simple implementation of the <dtml-tree> tag...as you can see
from the output below:
Here, the <dtml-tree> tag dynamically searches for the objects in the current folder and lists them by ID. It is obvious that, by default, it lists only the folders in the current location.
I now have a listing of all the objects in the current folder along with a neat little icon that allows downward traversal. Give it a shot and you'll see that you can now see all the objects under the current folder.
The additional "branch_expr" attribute of the <dtml-tree> tag is used to specify
the expression that will be evaluated by Zope to display the listing of the objects in the tree. The "sort" attribute tells Zope to sort the list by ID.
Want to play around with the code shown above? Just add the "reverse" attribute: