[pmwiki-users] Modify the result of a search

Martin Kerz mkerz at mac.com
Mon Mar 9 15:56:11 CDT 2009


Dear Pm,

> I suggest looking at the ?action=rss and WebFeeds code instead --
> effectively what WebFeeds does is convert pagelists into XML output
> of various forms.

ah, yes, that's great!

> Or, if you can describe what you want the xml output to look
> like, I bet we can come up with a simple recipe that you and
> others can use as a starting point.

I tried it myself and came up with something like this:

## Settings for ?action=livesearch
SDVA($FeedFmt['livesearch']['feed'], array(
   '_header' => '<?xml version="1.0" encoding="$Charset"  ?>',
   '_start' => '<ul class="LSRes">',
   '_end' => "</ul>';
SDVA($FeedFmt['livesearch']['item'], array(
   '_start' => "<li class=\"LSRow\"> <a href=\"{\$PageUrl}\">{\ 
$Title}</a>",
   '_end' => '</li>'));

I hope that produces somethind like this example, I got from here: http://blog.liip.ch/livesearch.php?q=PHP

<?xml version='1.0' encoding='utf-8'  ?><ul class='LSRes'><li  
class="LSRow"><a href="archive/domxml-and-php-5.html">domxml and PHP  
5</a></li><li class="LSRow"><a href="archive/fetching-a-looot-of-feeds- 
with-php.html">Fetching a looot of feeds with PHP</a></li></ul>

What I'm not sure is, if I got all the escape characters and  
differences between " and ' right. I couldn't see a pattern when to  
use the former or the latter.

My final goal would be to trigger the search with an adapted  
searchform and get the xml-file back for a livesearch, like it is  
described here: http://wiki.flux-cms.org/display/BLOG/LiveSearch
I don't see yet how to combine the generated xml-file with the search  
routine. Could you give me another clue?

Thanks a lot


Martin

--
Martin Kerz
martinkerz at me.com







More information about the pmwiki-users mailing list