[Zope] How to create "Locked" folder tree?

Chip Vanek chip@upcast.com
Tue, 15 Feb 2000 13:25:33 -0800


Hi,

Does anyone know how to "lock" the namespace (dtml-with or dtml-let)
inside dtml to ensure that the dtml-tree tag always displays the same
tree?

Or alternatly what is the ideal syntax to create an dtml-if that
can check if the present method is below the tree tag.  I am using
the code below but, it only works if I am in the Pub folder not in
any of the children folders of Pub.  

   <dtml-if "_.getattr(PARENTS[0], 'id') == 'Pub'">
          <dtml-tree .......>
   </dtml-if>

Any help would be GREATLY appreciated.

Best,

Chip

>-----Original Message-----
>From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Chip
>Vanek
>Sent: Monday, February 14, 2000 9:30 PM
>To: zope@zope.org
>Subject: RE: [Zope] How to create "Locked" folder tree?
>
>
>Searched many, many postings and found some hints but no solutions yet.
>
>The trick below works if you call the method from a branch below.
> <dtml-tree expr="PARENTS[-2]" branches_expr="objectValues('Folder')"
>sort=id>
>      <a href="<dtml-var tree-item-url>/index_html">
>        <dtml-var title_or_id></a>
> </dtml-tree>
>
>The problem is I want to use this tree as a navigator for one branch of
>the site while users may be down in another branch of the site at the
>same depth (like the Members area).  The code above will paint a tree
>with tortured URLs if the user1 is viewing their index_html page.
>
>http://host.com/SiteRoot/
>                         Pub/
>                            Folder1
>                            Folder2
>                              Branch1
>                              Branch2
>                            Folder3
>                               .....
>
>                        /Members/
>                               user1
>                                    index_html
>                               user2
>                                 .....
>>
>>I need to "lock" aquisition to all me to display a tree of folders. I
>>have a tree navigation control called by standard_html_header that I
>>would like to always show a subtree of my site.  I think that I have
>>to limit the namespace but can't seem to get the syntax right.  How
>>do I lock the root of the tree tag to one specific place in the
>>heirarchy?  My latest code attempt is below:
>>
>>
>><dtml-with "PARENTS[-1].SiteRoot.Pub">
>>    <dtml-tree Pub branches_expr="objectValues('Folder')" sort=id>
>>         <a href="<dtml-var tree-item-url>/index_html">
>>             <dtml-var title_or_id></a>
>>    </dtml-tree>
>></dtml-with>
>>
>>Thanks for your help.
>>
>>Chip Vanek
>>chip@upcast.com
>>
>>
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://lists.zope.org/mailman/listinfo/zope
>**   No cross posts or HTML encoding!  **
>(Related lists - 
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
>
>