[Zope] URL Recognition Question

Cornelis J. de Brabander brabander@fsw.LeidenUniv.nl
Tue, 16 May 2000 08:55:28 +0200


> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Tom
> Scheidt
> Sent: maandag 15 mei 2000 19:39
> To: zope@zope.org
> Subject: [Zope] URL Recognition Question
>
>
> Thanks Geir.
>
> I realized I made a mistake though, what I actually need is:
>
> <dtml-if (this page is in the /page folder)> do something </dtml-if>
>
>

What I do to find out whether a document is in a specific tree is to check
its PARENTS:
<dtml-in PARENTS>
 <dtml-if "id == 'folder name'">
  <dtml-call "REQUEST.set('bingo', 1)">
 </dtml-if>
</dtml-in>
<dtml-if bingo>
 do something
</dtml-if>

Of course, you can restrict your quest to the first PARENT.

cb