[Zope] How can you tell if what kind of object it is?

Loren Stafford lstafford@icompression.com
Tue, 9 Nov 1999 13:20:38 -0800


> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> Adrian Esteban Madrid
> Sent: Tuesday, November 09, 1999 12:58
> To: Zope List
> Subject: [Zope] How can you tell if what kind of object it is?
>
>
> Is there something like _.isDTMLMethod, _.isDTMLDocument, _.isFolder
> hidden somewhere? I've been browsing the documentation but have not been
> able to figure this out. I need that to create a dynamic navigational
> bar that sshould get set like this:
>
>       <dtml-call "REQUEST.set('fobs', [])"> <!-- Folders -->
>       <dtml-call "REQUEST.set('dobs', [])"> <!-- Documents -->
>       <!-- Fill Folders and Documents -->
>       <dtml-in "PARENTS[0].objectValues()" skip_unauthorized>
>         <dtml-let item="_.getitem('sequence-item', 0)">
>          <dtml-unless "hasProperty('hidden') and hidden">
>             <dtml-if "item.isFolder"> <!-- This is what I'm looking for!
> -->
>               <dtml-call "fobs.insert(0, item)">
>             <dtml-elif "item.isDTMLMethod"> <!-- This is what I'm
> looking for! -->
>               <dtml-call "dobs.insert(0, item)">
>             </dtml-if>
>           </dtml-unless>
>         </dtml-let>
>       </dtml-in>
>
> Any ideas?
>
> --
> Adrian Esteban Madrid
> Network Support, ATS
> Brigham Young University

In http://www.zope.org/Members/lstaffor/Breadcrumbs I used statements
like...


   <dtml-if expr="(meta_type == 'Message') or (meta_type == 'Reply')">

...and they seemed to do the trick.

You would write something like...

   <dtml-if expr="meta_type == 'DTML Method'">

   <dtml-if expr="meta_type == 'DTML Document'">

-- Loren