[pmwiki-users] form to search page names - one solution

Peter & Melodye Bowers pbowers at pobox.com
Tue Aug 5 10:22:47 CDT 2008


> In one page I created this simple form:
> 
> (:input form method=get action={$ScriptUrl}/Main/Search_results:)
> (:input text name=search_term:)
> (:input end:)
> 
> Then, in the page /Main/Search_results, I grab the variable passed with
> the GET method (?search_term=text_entered_in_the_box) and insert it in
> the (:pagelist:) directive:
> 
> (:pagelist name=*{$?search_term}*:)
> 
> It works, but I don't know if there are better solutions. Any other idea?

You could leave it on the same page and just surround your (:pagelist ...:)
with (:if !equal {$?search_term} "":)(:pagelist ...:)(:endif:).  That would
enable to you to immediately update your search term if you came up with the
wrong list.  (You would need to get rid of the action=... in the input form
as well as adding a (:input hidden name=n value={$FullName}:) or the
equivalent...)

You could also do the same thing with markup expressions, but I don't guess
there's any need for that since it's working without them...

-Peter




More information about the pmwiki-users mailing list