Home kellton

Main navigation

  • Services
    • Digital Business Services
      • AI & ML
        • Utilitarian AI
        • Predictive Analytics
        • Generative AI
        • Machine Learning
      • Digital Experience
        • Product Strategy & Consulting
        • Product Design
        • Product Management
      • Product Engineering
        • Digital Application Development
        • Mobile Engineering
        • IoT & Wearables Solutions
        • Quality Engineering
      • Data Science & Engineering
        • Data Engineering
        • Data Science
        • Visualisation & Analytics
        • Integration & API
        • RPA
      • Cloud Engineering
        • Cloud Consulting
        • Cloud Migration
        • Cloud Managed Services
        • DevSecOps
      • NextGen Services
        • Blockchain
        • Web3
        • Metaverse
        • Digital Signage Solutions
    • SAP
      • SAP Services
        • S/4HANA Implementations
        • SAP AMS Support
        • SAP Automation
        • SAP Security & GRC
        • SAP Value Added Solutions
        • Other SAP Implementations
      • View All Services
  • Platforms & Products
    • Audit.io
    • Kellton4Health
    • Kellton4NFT
    • Kellton4Commerce
    • KLGAME
    • tHRive
    • Optima
    • View All Products
  • Industries
    • Fintech, Banking, Financial Services & Insurance
    • Retail, E-Commerce & Distribution
    • Pharma, Healthcare & Life Sciences
    • Non-Profit, Government & Education
    • Travel, Logistics & Hospitality
    • HiTech, SaaS, ISV & Communications
    • Manufacturing, Automotive & Chemicals
    • Oil,Gas & Mining
    • Energy & Utilities
  • Insights
    • Blogs
    • Brochures
    • Success Stories
    • News / Announcements
    • Webinars
    • White Papers
  • Careers
    • Life At Kellton
    • Jobs
  • About
    • About Us
    • Our Partners
    • Our Leadership
    • Testimonials
    • Investors
    • Privacy-Policy
    • Contact Us
    • Our Delivery Centers
      • India Delivery Center
      • Europe Delivery Center
Search
  1. Home
  2. All Insights
  3. Blogs

Drupal 7 - Searching multiple fields in views using combine fields filter

Product Engineering
March 26 , 2013
Posted By:
Kellton
linkedin
Banner - Drupal 7 - Searching multiple fields in views using combine fields filter

Other recent blogs

Data Democratization
Data Democratization: A way forward to a data-driven culture
September 12 , 2023
iOS Mobile App Development Trends
Top iOS App Development Trends for 2023
September 04 , 2023
Sustainable cloud computing transformation Thumbnail
Enabling sustainable Cloud Computing Transformation with AWS Cloud sustainability
August 30 , 2023

For drupal development, it is required to display content using Views. Drupal allows us to create content with content type on our website. Content created in these content types can be displayed in various formats on drupal website with the help of views module. Sometimes, it is required to allow users to filter the content according to the fields available in content type and this functionality is provided by view exposed filters. In this blog, we will see what happens when end user is allowed to search multiple fields with single search field in view display page.

Let's create 'Event' content type which stores details of upcoming drupal events with field titles, details, start date, end date, contact person and email. Now, we need to show all events created in the site. For this, we create a simple view which shows list of content posted in event content type. Make sure that you choose fields in display format while creating the view. Below are basic settings of the view which you need to choose at the time of creating this view.

views1.jpg

This will provide us with a simple list of all events posted under event content type. Now, we will add search filter which allows user to search content in this view according to multiple fields with single search box.

For this, add another filter called 'Global: Combine fields filter'.

views2.jpg

In filter configuration form follow the instructions given below:

1. Check "expose this filter to visitor" checkbox and in 'operator' field.

2. Select 'contains' to search text.

3. In 'Choose fields to combine for filtering' field, select fields which you want your users to base their search on. Right now we want the user to search for event according to title and body.

views3.jpg

After applying this exposed filter, we will get a search box on top of the view display page and with this search box we can search content listed in the view.

One of the best uses of global combine fields filter is when we want to search a particular type of content from a search block on one of the regions on the site. For this, in views advanced area there is an option called "Exposed form in block:" Set this option to "yes" and save the view. Now go to blocks listing, there will be a new exposed form block with same name as your view. Assign this block a region so that views exposed search box will show up in selected region.

views4.jpg

Now, you will see that your search filter is shifted from views top region to your selected region. This search block is available on whole site, so it can work as global search for only events in the site. If we search 'London' in search box from any page of the site, it will take us to the upcoming Drupal events view page with search results of events content which contain 'London' text in its title field or body field.

views5.jpg

As you can see in above screen shot that for better usability, I changed block name to 'Search Upcoming Events' from block configuration and 'Filter' button to 'Search' button in views exposed form style settings. With global combine fields filter, we can add more exposed fields filter criteria for detailed search. It also allows us to create different search blocks for different type of content.

Want to know more?

iOS Mobile App Development Trends
Blog
Top iOS App Development Trends for 2023
September 04 , 2023
 Best frontend framework
Blog
10 Best Frontend Frameworks for Web Development in 2023
August 11 , 2023
full stack developer company
Blog
All You Need to Know About Full Stack Development: A Comprehensive Guide
July 17 , 2023

Leading through your Digital Transformation journey

North America: +1.844.469.8900

Asia: +91.124.469.8900

Europe: +44.203.807.6911

Email: ask@kellton.com

Footer menu right

  • Digital Experience
  • Data Engineering & AI
  • NextGen Services
  • About
  • Contact

Footer Menu Left

  • Product Engineering
  • Cloud Engineering
  • SAP Services
  • Careers
  • Success Stories

clutch Badge
GoodFirms Badge

© 2023 Kellton