[Zope-CMF] using the subject property

Tres Seaver tseaver@digicool.com
Sun, 01 Apr 2001 09:16:34 -0400


Ben Riga wrote:
> 
> >> 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>

Hmm, this works for me on a customized search form:

 <tr valign="top">
  <th>Subject</th>
  <td>
   <select name="Subject:list" multiple size="4">
    <dtml-in expr="portal_catalog.uniqueValuesFor( 'Subject' )">
     <option value="&dtml-sequence-item;"> &dtml-sequence-item; </option>
    </dtml-in>
   </select>
  </td>
 </tr>

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@digicool.com
Digital Creations     "Zope Dealers"       http://www.zope.org