For a site I now have a blog section and a gallery section. In the sidebar I have the searchform. What I would like is for the searchform to display only searchresults from pages/news when done from within the blog section, and only images when done from within the gallery section. Therefore (I guess), I could split the search.php template up into searchalbums.php and searchnews.php, but maybe there's an easier way?
Comments
http://www.zenphoto.org/documentation/functions/_functions-basic.php.html#functionsetOption
These are the option names for the four search items:
search_no_albums, search_no_news, search_no_pages, search_no_images
You would have to temporarily set this on the page type you have the search page and then probably have to make a custom searchform that appends a GET or POST statement so that the search page "knows" (as temporatily set options vanish on the search page naturally) that it has to set the options as well. Or you could check from what page you came using the HTTP referrer maybe.
Or you set the options permanently and reset them on the search page after the results (of course then the search there would be for all types again).
Sounds like a good idea to have this as a parameter for the search form (you can already limit search to one or more specific album btw). Please open a ticket as well.
Splitting would be an easy way but you would need custom search forms as well.