I want to add a custom search option on my drupal theme in a block. It will be a form with a text box and few checkboxes. All that the form has to do while submitting is.. generate a search url based on the checkbox state.
http://localhost/restaurant/search/node/type:restuarant category:34,38 %keyword%
The keyword will be the text in the search box and category will be added according to the checkbox state. I know to do this in an ordinary php site but have no idea how to implement this in my drupal theme.
I Checked the form api, I understood about creating a form in a module… and accessing it via a url like
But didn’t get any clue on how i could put it in a block in my template.
Implement
hook_block(), set up a custom submit handler in your form using$form['#submit'], and in your custom submit handler, set$form_state['redirect']to your custom URL. Example: