[Zope] How to exclude Confera messages?

Loren Stafford lstafford@icompression.com
Wed, 25 Aug 1999 13:44:29 -0700


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')"-->
 &gt;&nbsp;<font size="+1" color="#990000"><b><!--#var
title_or_id--></b></font>
  <!--#/unless-->
 <!--#else-->
  <!--#if expr="(meta_type == 'Message') or (meta_type == 'Reply')"-->
 &gt;&nbsp;<a href="<!--#var absolute_url-->"><!--#var title_or_id--></a>
  <!--#else-->
 &gt;&nbsp;<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-->
>