Hi,
I'm looking for a way to add some parameters to the search box like, for example, checkboxes corresponding to some tags I use in order to limit the search results to these parameters.
For example :
search form
checkbox tag 1 checkbox tag 2 *checkbox tag 3
Do you have any idea about how to proceed ?
Thank you for your time.
I wish I did, this would be a trememdous feature. But so far we have had problems with the styling of the feature--how to get it to be available but unobtrusive.
There is code in admin-options.php for making a checkbox list of the possible search options (including checking the ones that are set by the options.) This could easily be made into a function that could be called from the printSearchForm() function.
The Post handling of the search request would have to be extended to process this list. All this is doable and not too hard if the first issue of styling can be handled.
If you are interested in collaberating on this, I will be glad to do the "easy" part.
Thank you for your answer Stephen.
Yes I'd love to collaborate with you on this (even if I don't see what I could do that you can't do yourself !).
IMHO, in a first time, have it as an option would be nice with calling a special function.
Well... just tell me what you want me to do !
I've released the base code into the current SVN. Currently there is a comment around the code that activates it in printSearchForm() in template-functions.php. If you remove the comment you will get the checkbox list. But it is "out of place". It needs to be hidden so that with some sort of icon to click on to show it. I am not so good at CSS and styling stuff.
See if you can make it look pretty!
Well, I did a bit more work. It is now an acceptable implementation all be it some improvement would be welcome.
The search fields are hidden and exposed when you click on an icon between the input field and the search button. (But it there is only one possible field, all this is supressed.)
The searcher may choose any field from the list that the admin has designated as allowed fields. The form will remember the fields used on the last search (of that form) and offer those as the default set of fields.)
You probably should wait for tonight's build or the current SVN since acrylin has also colaborated on the effort. But, in answer to your question, the nightly build represents the SVN as of 11:00pm Pacific time. The SVN perhaps has more recent changes. If we had not made changes today then you would be correct that the two were equivalent.
I'd like to have more criterias available :
For example in my gallery, I've tagged every image with "color photography" or "black-and-white photography".
I'd like to display two checkboxes with these values under the search field.
Do you have any idea about how to proceed ?