[Zope-CMF] using the subject property

Ben Riga briga@borland.com
Fri, 30 Mar 2001 16:54:48 -0800


>> How can I build a list of all the subjects that have been used?
>
>Ask the catalog:
>
>  <dtml-in expr="portal_catalog.uniqueValuesFor( 'Subject' )" >

I've tried this a bunch of different ways but can't get it to give me the
list of subjects.  It is definitely iterating through something.  I just
don't know how to get at the data to display it.  Can you point me to an
example I can study to learn more about this?

I've copied my snippet below.  It's in a DTML-method at
/DSP/portal_skins/custom/SubjList.  I'm calling it with a <dtml-var
SubjList> from the /DSP/portal_skins/custom/index_html.

<dtml-in expr="portal_catalog.uniqueValuesFor( 'Subject' )" >
  <tr class="SubjItemRow">
  <td valign="top">
     sequence-number: <dtml-var sequence-number>
     sequence-key: <dtml-var sequence-key>, title: <dtml-var title><br>
     id: <dtml-var id><br>
      <DIV><HR></DIV>
  </td>
  </tr>

>> How do I now query for all the objects that are related to a subject?
>
>Use a Topic, with a criterion against the 'Subject' field.

Very Cool!  I thought I had tried this before and not had success.  I tried
again with the 1.0 release and it works exactly like I want it to!!

This stuff rocks!
Ben