adding checkboxes to the search form

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.

Comments

  • 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.)
  • Hi Stephen,
    The svn and the last nightly version are the same thing, right ?
  • 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.
  • Ok, I'll give a try with this one.
    Thank you for your time.
  • Woaw, it works great for me !
    I'm about to try to customize what you've done with checkboxes of my own tags.
    Thank you !
  • Just noticed some really minor typos with checkboxes as 'Descripton' in the displayed fieldset and "serach criteria" in the admin options panel.

    The criterias are not multilingual, aren't they ?
  • 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 ?
  • You would have to make some kind of auto fill of the search criteria itself as these are not fields to be searched but values to be looked for. Look at the tag suggest plugin. That might be a good starting point.
  • The criteria are not multi-lingual, but of course, you can have multiple tags, one for each language.
Sign In or Register to comment.