« Full Menu Tree with Active Trail in Drupal 6
» Show a list of items related to the current node

Drupal, How To

Enable Keyword-Search Within a View

04.30.09 | Comment?

This mini tutorial guides you through the steps required to create a view that can be filtered or searched using keywords. When the View is run, the Views module joins the result of the View with the Drupal search index, yielding a filtered sub-set. You can choose to have the search box above the view results, or in a separate block (step 3).

Versions used: Drupal 6.10 with Views 6.x-2.3

  1. Create a View and add some fields and filters as you normally would, or open an existing view
  2. Add a Page display
  3. Optional: Set Basic Settings > Exposed form in Block to Yes to disconnect the search box from the View into a Block
  4. Add a Filter Search > Search Terms
    • Click Expose
    • On empty input: Show all
    • Filter identifier: q (i.e. mysite/mypage?q=keyword)
    • Label: Filter by keyword
    • Optional: checked

have your say

Add your comment below, or trackback from your own site. Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

:

:


« Full Menu Tree with Active Trail in Drupal 6
» Show a list of items related to the current node