Menu icon
RedCrackle
Menu icon
Services
01Design Transformation
About UsCase StudiesBlogContact Us

<

Blog post

Using views filter in Drupal 7

Neerav Mehta

Founder & CEO

Filters are used to specify selection criteria to select required records from a table. Therefore, using filters in views can help us reduce the result set to the required amount of data. We can add multiple filter criteria. In Drupal 6, all the filters are ANDed together, but in Drupal 7, we have the option to add the criteria as AND and OR.

  1. Create a view
  2. Then click on the "Add" button.
  3. A list of filters will be available. For eg. "Content: Type", "Content: Has taxonomy term", "Content: Post Date", etc.­­­ Select any filter criteria as per your requirement.
  4. Add other options related to those criteria. Each criterion contains different options (according to the content).
  5. Exposed filters are displayed to the user. Users can control the filter and modify the result set. In Drupal 7, we have the option to choose between “single filter” and “grouped filter”. You can expose any filter.

Configure Views Filters in Drupal 7

We can create advanced search using views filter in views. Let us create a Job search functionality using views.

  1. Create a content type with the following fields.
  • Job Title
  • Job Description
  • Job Category
  • Experience Required
  • Minimum Salary Expectation
  • Maximum Salary Expectation
  • Location
  • Skills Required
  • Designation
  1. Add few contents of the type Job

  2. Create a view with the following information.

  • Title: Search
  • Format: Format – Unformatted list, Show – Content|Teaser
  • Fields: The content format does not utilize fields. Select Show: Fields if you want to add fields.
  • Filter Criteria: Add the following filters with OR operator.
    • Content Type: Is one of Job (= Job)
    • Content Published (Yes)
    • Taxonomy Term: Job Category: Expose
    • Content: Location: Expose
    • Content: Location: Expose
    • Content: Experience: Expose
  1. Sort Criteria: Content: Post date (desc)

  2. Path: /job-search

  3. Save the view and check the view on the page sitename/job-search

Neerav Mehta

Neerav Mehta

Founder & CEO

Neerav Mehta is the Founder & CEO of Red Crackle. With sterling qualities, Neerav’s technological acumen is firing a generation of progressive companies on the digital path. With an undergraduate degree in Electrical Engineering from India's most prestigious institution IIT Bombay and having spent seven years developing and contributing to the launch of AMD's innovative line of computer products, Neerav founded Red Crackle where he is lauded for his dynamic and innovative genius.

View all posts

>

Read Next

10 Tips For Entrepreneurs In 2015

10 Tips For Entrepreneurs In 2015

Learn more

10 Ways To Increase Productivity At Work

10 Ways To Increase Productivity At Work

Learn more

30 best WordPress widgets for your site

30 best WordPress widgets for your site

Learn more

Let’s get you started!

Contact Us

>

RedCrackle

Explore

About Us

Services

Contact Us

Our address

5346 Gerine Blossom Dr,

San Jose, CA 95123

USA

Socials

Twitter
LinkedIn

© 2023 RedCrackle. All rights reserved.