O'Reilly logo

Drupal 8 Blueprints by Alex Burrows

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exposed filters as a block

Inside our view, we have the option to expose our search filter by default. This will then generate a form that will appear at the top of our view. However, if we decided we want to have our search form on every page, then we need to convert the form to a block.

Let's start by exposing our locality part for our address field we created, so click Add, search for locality,  and select that row. Repeat the same for administrative_area; again, repeat this and select country_code for our website. We will have properties in United Kingdom, but you can have yours wherever you want, and finally, add postal_code and click Add and configure filter criteria.

Now that's done, you will see the settings for our first filter, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required