[ZPT] using z search interface

Dieter Maurer dieter@handshake.de
Thu, 29 Aug 2002 20:48:53 +0200


Sumiya Sakoda writes:
 > i try to zpt recently.
 > 
 > z search interface generate search form and query result page
 > automatically, it is so helpful.
 > 
 > but zpt seams not to support 'seaquence-query' variable.
 > so, this zpt code is not including QUERY_STRINGS except for 'start'
This is a bug!

Please file a bug report to <http://collector.zope.org>.

On my zope page

  <http://www.dieter.handshake.de/pyprojects/zope>

you will find a ZPublisher patch "Image Button Support; :last suffix".

   This patch is there to work around the lack of "sequence-query".
   With it, you can use:

	<a tal:attributes="
	   href string:${request/URL0}?${request/QUERY_STRING}&start:int:last=${...};
	   "
	>

An alternative would be:

   <a tal:define="
      start	....
      dummy	python:request.form.update({'start':start});
      urlencode nocall:modules/Products/PythonScripts/standard/urlencode;
      qs	python:urlencode(request.form);
      "
     tal:attributes="
      href 	string:${request/URL0}?${qs};
      "
      >

You will need a very recent Zope version that "urlencode" will be
available via "Products/PythonScripts/standard" (Zope 2.6 or CVS version).
But, you can easily put "urlencode" there in your older Zope version.


Dieter