[Zope-CMF] Pulldown list of members
Tres Seaver
tseaver@zope.com
05 Jun 2002 23:36:18 -0400
On Wed, 2002-06-05 at 19:48, Kelley, Sean wrote:
> Hi,
> I want to create a pulldown list of members or creators on the CMF advanced
> search page so that instead of having to type the user name fully and
> correctly when searching by creator, there would be a handy list to select
> from. Does anyone have any idea how to do this or has someone done it?
> Seems like it would be a good standard component of CMF skins and should
> only list creators as opposed to all members. I am new to zope and CMF so I
> am nearly useless at this type of thing.
ZCatalogs have a method, 'uniqueValuesFor', which returns the set of
possible values in an index. You might use it so (untested)::
<select name="creator">
<option value="" selected>Any</option>
<option tal:repeat="uc
python:here.portal_catalog.uniqueValuesFor('Creator' )"
tal:attributes="value uc"
tal:content="uc">CREATOR</option>
</select>
Tres.
--
===============================================================
Tres Seaver tseaver@zope.com
Zope Corporation "Zope Dealers" http://www.zope.com