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
At 21:57 9-11-99 , Adrian Esteban Madrid wrote:
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:
Just check out the meta_type property of the object.
<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)">
This is not needed. The current item is on top of the namespace stack, any method or property is first searched for there.
<dtml-unless "hasProperty('hidden') and hidden"> <dtml-if "item.isFolder"> <!-- This is what I'm looking for! -->
<dtml-if "meta_type == 'Folder'">
<dtml-call "fobs.insert(0, item)"> <dtml-elif "item.isDTMLMethod"> <!-- This is what I'm looking for! -->
<dtml-if "meta_type == 'DTML Method'">
<dtml-call "dobs.insert(0, item)"> </dtml-if> </dtml-unless> </dtml-let> </dtml-in>
-- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | T: +31 35 7502100 F: +31 35 7502111 | mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ---------------------------------------------
-----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
participants (3)
-
Adrian Esteban Madrid -
Loren Stafford -
Martijn Pieters