XajaxSearch

Summary: Provide a better way to show search results.
Version: 2005
Prerequisites: pmwiki-2.0
Last-tested-on: pmwiki-2.0.12
Status: development
Maintainer:
Categories: Searching, Ajax
Votes:

Goal

Provide a better way to show search results.

Answer

This recipe uses ajax to provide a preview of the found pages (see example here).

  • Download the package xajaxsearch.zipΔ and put all files in the appropriate folders
  • Write in your config.php as the last entry:
          $XajaxInclude[] = "xajaxsearch";
 	  include_once("$FarmD/cookbook/xajaxpmwikiglue.php");
  • Put in your skin .tmpl file right before the </body> tag:
          <!--markup:(:XajaxArgs:)-->
  • Replace on your search site (Site.Search):
     
     (:searchbox:)
     (:searchresults:) 

with
     (:searchboxajax:)
     (:searchresultsajax:)

Notes

I just wanted to play a little bit with ajax and this receipt was the result. Because it is not completly useless I put it up here.

This receipt was tested with Safari, Opera, Firefox and Camino.

The recipe works fine with PmWiki 2.0.12. Between this version and 2.1 it breaks and needs to be updated.

Releases

Comments

  • This is nice and all, but shouldn't the Ajax stuff all be separated out. At a quick glance it looks like all one needs is the xajaxpmwikiglue.common.php, generateargs.php and xajax.inc.php files to get basic Ajax functionality (using the include_once("$FarmD/cookbook/xajaxpmwikiglue.common.php"); line). Then just add your own code to built some new Ajax actions for your wiki. Is this is the case? If so, I say it should be separated out into its own recipe, and then any recipes that use it (like xajaxsearch) would list the xajax recipe as a dependency. Just a suggestion. (Waylan October 27, 2005, at 02:32 PM)

Yes. I thought about this direction too and this is why I already started splitting up the files in this way. But I didn't decided yet what would be the easiest way and is it really clever to use a <div> and ParseArgs() arguments to interchange between PmWiki and xajax. From my php amateur point of view it is ;). So I really appreciate your comments. - Schlaefer October 29, 2005, at 03:52 AM

On the latest version I tried to simplify the process and put all the glue stuff into one single file. To get things started I ported a simple example from the xajax homepage that reflects the current usage. - Schlaefer October 29, 2005, at 02:41 PM

See Also

Contributors

User notes : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.