AlexA
AlexA

Reputation: 4118

Searching views in Drupal

How do you add Search form to your Views in Drupal?

Do I have to edit specific view template and add to it form-creating code that posts arguments to my view? Should form's method URL be simply view's URL and form fields the same as view arguments? Is that all the tricks I need to know?

Upvotes: 0

Views: 172

Answers (2)

Stallion
Stallion

Reputation: 1

  1. Go to your Views where you want to implement the search functionality.
  2. Add a Filter Criteria. Search for Global: Combine fields filter(this allows you to combine two fields together and search by them).
  3. Make sure it is exposed.
  4. Select the fields that you want to filter by.
  5. Save the View and you are done. You should get a text box to search.

Upvotes: -1

ceejayoz
ceejayoz

Reputation: 180176

All you have to do is create filters and hit the 'expose' button on them. This'll allow the user to manipulate those filters to their heart's content.

Upvotes: 2

Related Questions