BackTalk to Document The Zope Book (2.6 Edition)/Searching and Categorizing Content

[email protected]
Newsgroups gmane.comp.web.zope.zdp
Message-ID <[email protected]>
A comment to the paragraph below was recently added via http://zope.org/Documentation/Books/ZopeBook/2_6Edition/SearchingZCatalog.stx#3-82

---------------

      Often you will use a small list of terms with KeywordIndexes.
      In this case you may want to use the 'uniqueValuesFor' method to
      create a custom search form. For example here's a snippet of a
      Page Template that will create a multiple select box for all the
      values in the 'keywords' index::

        <select name="keywords:list" multiple>
          <option 
            tal:repeat="item python:here.uniqueValuesFor('keywords')"
            tal:content="item">
              opt value goes here
          </option>
        </select>

        % Anonymous User - Nov. 25, 2003 7:42 am:
         please refer to Products/PluginIndexes/README.txt to change the operator! the default is OR, not AND.

        % Anonymous User - Nov. 25, 2003 7:49 am:
         add
         <input type="hidden" name="keywords.operator:record" value="and">
         and change
         <select name="keywords:list" multiple>
         to
         <select name="keywords.query:list:record" multiple>

         to get as search-result only entries containing _all_ selected keywords.

        % Anonymous User - Dec. 6, 2003 7:00 am:
         what about if keyword is empty? eg <input name=keywords> and you leave it blank. It doesn' return anything
         instead of all. This is a problem.

_______________________________________________
ZDP maillist  -  [email protected]
http://mail.zope.org/mailman/listinfo/zdp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.