Re: Search hook docs?
[email protected] (mikespub) Sat, 25 Sep 2004 09:22:44 GMT
| Newsgroups | gmane.comp.cms.xaraya.documentation |
|---|---|
| Organization | Not much, really... |
| Message-ID | <[email protected]> |
In article <opseuvi3wtrrjz92-hMO2MehxN5WpW6/[email protected]>, "Andy Staudacher" <[email protected]> wrote: >Is there an easier way to learn how to create a search hook >than to check how it was done in the comments or the xarbb >modules? >Is there any documentation on this topic? >- what vars are supplied as argument, what's their format >- what's the expected return value of the search hits, >should my function create urls and if not, where are the urls built,... >- ... This explains the overall structure : http://www.xaraya.com/documentation/rfcs/rfc0042.html#rfc.section.5.4 (replace xarVarCleanFromInput with xarVarFetch) The search form contains 2 pre-defined input variables $q and $author. If they're empty, the function should return part of the input form with additional input fields that might be relevant to your module, like which fields should be searched, or some other relevant selection criteria - or simply return an empty string if nothing needs to be added to the input form. If they're not empty, the function should return its list of results in HTML format. This may include pagination e.g. when you have more than N results - in that case, the search function should be able to work on its own as well, i.e. without being called via hooks, so that it can show the next pages of results by itself. You can find a more extensive example in the articles module. Mike.