Exposed Form in Block

Learn how to switch to an exposed block. This will allow you to move the exposed filters into any region.


Trainer (00:00):
By default, the exposed form is displayed above the view, just like it is right here, but it can be configured to be displayed as a block, which means you can add it into any region. Let’s go ahead a.

Trainer (00:12):
Nd turn this exposed form into a block. So hover over the view and then edit the view, then go to advanced and click on no, next to exposed form in block, and then select yes and click on apply. Now, one thing to be aware of is that as soon as you switch the exposed form to a block, if you scroll down to the preview section, you won’t see the exposed filters here in the preview above the view, because now, the exposed form is a block. So that’s just one thing to be aware of.

Trainer (00:43):
So let’s save the view, and to add the exposed form back in, we need to add it to a region just like any other block. So click on structure and I’ll open that up in a new tab, click on block layout and scroll down and click on place block next to a region and search for latest. And you will see the latest articles block view. This is the view that we created previously, and then below that you will see exposed form. This is the block that we need to add to the region so click on place block, and then uncheck display title, and let’s restrict this block so it only appears on the latest articles page.

Trainer (01:22):
So I’ll add in /latest-articles, and then click on save block,

Trainer (01:29):
Scroll down and click on save blocks. Let’s close this tab. And if we refresh, we can see the exposed form in this region. So if I search for an article and then click on find it’ll filter the view on this page. So if you want to change the location of the exposed form, simply switch it to a block and then add it into a region. Now for this site, I actually prefer to have the exposed form above the view, so I will revert it all back. So let me just remove the block and then let’s edit the view and switch this back to no.

Scroll to Top