0

I'm trying to create a search in Drupal 7 using views. I can create the basic search easily, but I'm trying to have the search work like http://leg.colorado.gov/.

I have a view created with a block that has an exposed filter, and a page with multiple exposed filters. I'm trying to get the block to pass the searched term to the page where a user can use more filters to specify what they're looking for. However, all I can seem to do is create a block that performs a search within the block.

Is it possible to set this up using admin configuration in Drupal 7 views, and if so, how? Or would this required coding or other modules?

Thanks

1 Answer 1

0

I think this question may have some similarities to How to pass a value from form(block) to the page and show this page?

The trouble with what you are asking is trying to have two distinct parts of your page act on one interaction: the block form submit and then the page search view filter form submit. Each is in fact a separate function which have no relationship in the Drupal backend. To get this to work you could use some jQuery magic to get the value selected in Block filter be cloned into the page search and do a submit on the form. You may have to do some coding using cookies or session values to ensure the values are also reloaded into the block filter criteria if you wish to keep those synchronized.

Since you have several ways of going about this, stick to one that is easiest to work with at first. jQuery is often the most convenient though maybe less elegant in some cases.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.