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

Cornelis J. de Brabander brabander@fsw.LeidenUniv.nl
Wed, 16 Feb 2000 09:40:32 +0100


> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Chip
> Vanek
> Sent: dinsdag 15 februari 2000 22:26
> To: zope@zope.org
> Subject: RE: [Zope] How to create "Locked" folder tree?
>
>
> 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>
>
My solution reads:
 <dtml-call "REQUEST.set('authorized', 0)">
 <dtml-in PARENTS>
  <dtml-if "id=='Pub'">
    <dtml-call "REQUEST.set('authorized', 1)">
  </dtml-if>
 </dtml-in>
 <dtml-if authorized>
  <dtml-tree ...>
 </dtml-if>

cb