-----Original Message----- From: Loren Stafford [mailto:lstafford@icompression.com] Sent: Wednesday, August 25, 1999 2:56 PM To: zope@zope.org Subject: RE: [Zope] How to exclude Confera messages?
With Michel's help, I got the following navigation stack method running at http://209.67.167.51/Quena/Discuss. It no longer causes an error when I navigate to a Confera message, but it doesn't do the right thing either. Try it.
What I don't know how to do is test the type of the current object from inside an <!--#in--> loop. That is, how do I test if sequence-item is a 'Folder', 'Confera Topic', 'Message', or what? Can you help?
Use it's meta_type: <!--#in sequence_of_objects--> <!--#if meta_type == 'Folder'--> I am a folder <!--#/if--> <!--#/in--> You can also just say what it's meta type is, or put it's <!--#var icon--> next to it so that it looks different. -Michel
-- Thanks -- Loren
<!-- Start Breadcrumbs --> <!--#unless expr="PARENTS[0]==PARENTS[-1]"--> <!--#call "REQUEST.set('reverse_PARENTS', [])"--> <!--#in PARENTS skip_unauthorized--> <!--#call "reverse_PARENTS.insert(0, _['sequence-item'])"--> <!--#/in-->
<!--#in reverse_PARENTS--> <!--#var sequence-item--> <!--#if sequence-start--><a href="/">Home</a> <!--#else--> <!--#if sequence-end--> > <font size="+1" color="#990000"><b><!--#var title_or_id--></b></font> <!--#else--> > <a href="<!--#var absolute_url-->"><!--#var id--></a> <!--#/if--> <!--#/if--> <!--#/in--> <!--#/unless-->
<!-- End Breadcrumbs -->
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
OK. I think I've got the "breadcrumbs" nav-stack method working right, if not working elegantly, on Confera Topics. Try it at http://209.67.167.51/Quena/Discuss. I added the meta_tag tests. I also added some debug info that shows up if you do View/Source in the browser. The wierd thing is that the meta_tag of a Confera Topic is different depending on your location in the topic: - If you're at the top of the topic, it's "Confera Topic" (as you would expect). - If you're at a message, not only does the message have a meta_type of "Message", but the containing Topic object says it's meta_type is ALSO "Message". (Similarly for replys.) Is this an example of "reverse acquisition"? The result in the script is a lot of extra logic just for Confera Topics. Is all this worth a How To entry? -- Loren. <!-- Start Breadcrumbs --> <!--#unless expr="PARENTS[0]==PARENTS[-1]"--> <!--#call "REQUEST.set('reverse_PARENTS', [])"--> <!--#in PARENTS skip_unauthorized--> <!--#call "reverse_PARENTS.insert(0, _['sequence-item'])"--> <!--#/in--> <!--#in reverse_PARENTS--> <!-- Debug <!--#var sequence-index-->: <!--#var sequence-item--> : <!--#var meta_type--> --> <!--#if sequence-start--><a href="/">Home</a> <!--#else--> <!--#if sequence-end--> <!--#unless expr="(meta_type == 'Message') or (meta_type == 'Reply')"--> > <font size="+1" color="#990000"><b><!--#var title_or_id--></b></font> <!--#/unless--> <!--#else--> <!--#if expr="(meta_type == 'Message') or (meta_type == 'Reply')"--> > <a href="<!--#var absolute_url-->"><!--#var title_or_id--></a> <!--#else--> > <a href="<!--#var absolute_url-->"><!--#var id--></a> <!--#/if--> <!--#/if--> <!--#/if--> <!--#/in--> <!--#/unless--> <!-- End Breadcrumbs -->
What I don't know how to do is test the type of the current object from inside an <!--#in--> loop. That is, how do I test if sequence-item is a 'Folder', 'Confera Topic', 'Message', or what? Can you help?
Use it's meta_type:
<!--#in sequence_of_objects--> <!--#if meta_type == 'Folder'--> I am a folder <!--#/if--> <!--#/in-->
participants (2)
-
Loren Stafford -
Michel Pelletier