Hi

I've made a exposed filter block.

I've placed the block on the homepage.

I want to make it so when someone
choose exposed filter block i.e cars.

It goes to the car page.
How do I this please?

Many thank for your help

Comments

vm’s picture

sounds more like you want a jump menu and not an exposed filter.

charlie charles’s picture

Thank for your feeback VM.

I'm trying to make a exposed view filter like this
where you fill in the result and then it jumps to the results page

http://www.tripping.com/

Do you know how this is done please?

vm’s picture

tarekdj’s picture

You can follow VM's link for creating exposed form block. This will make the form working only in you view page. If your form is in another page you have to alter the action link.
To do this you can implement hook_form_alter() in a custom module as follow:

/**
 * Implementation of hook_form_alter()
 */
function MODULE_NAME_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'YOUR_FORM_ID') { // Replace by your form_id
    $form['#action'] = base_path().'YOUR_VIEW_PATH';  // Replace by your view path
  }
}
charlie charles’s picture

Thanks for your great help tarekdj

I have two content types
that use the same city term

i.e car for sale or car's wanted

How would I add a radio button
for users to choose which
content type they want to search for
i.e City "New york"
"car for sale" or "car's wanted"

Many Thanks for your help

tarekdj’s picture

Are you using the same view for listing results ? Or 2 separate views for each content type?

glenshewchuck’s picture

tarekdj solution works great.

Just an FYI, if you are using the module "Views Block Exposed Filter Blocks" ( https://www.drupal.org/project/views_block_filter_block ) to allow an exposed filter on a view display type of block then be aware that views_block_filter_block module also alters the $form['action'].

So you need to make sure your hook is executed after views_block_filter_block either by having your module named later alphabetically or your module's weight should be greater than views_block_filter_block's weight (which is zero).