How to search across fields of a view using "Combined fields filter"?

Hello,

We are trying to implements a search bar for our job page and would like to have the possibility to search through different fields (title, job description …) without having multiple fields. I came across a great tutorial (https://youtu.be/2xuR2pyhHK4) showing how to implement it with Drupal 8.

We have different fields under Structure -> Content type -> Job posting (our custom view) -> Manage fields.

However when i try to implement the Combine fields filter from Structure -> Views -> Job page -> Edit -> Add (Under filter criteria) -> Combine fields filter. None of the fields in content type are available.

Do you guys have any idea why ? Is that a specific limitation of the Cern override theme ?

Thank you very much :slight_smile:

Maxime

Dear Maxime,

CERN override theme or any other theme doesn’t affect back end operations like editing views etc. So I think there might be a misconfiguration of the module that you are using or the view.

Kind regards,
Sotirios

Hey Maxime,

I just had a look at your view and you have set the Accordion display format as your format. By default, the “Display Suite: Content” option “hides” the fields so that the users won’t be mislead thinking that they can change the fields from the Fields option of the view, since they change the fields from the Manage Display interface of the Content Type.

There is a workaround though: If you click on “Settings” next to the Accordion, then in the settings of the Format you can check the Force using Fields option. By checking this option, you can use the fields in the view and combine them, as described in the video you posted.

Important Note: When you check this option, you can add/remove fields from the view. However, this does not mean that you choose which fields will be displayed. This option is still in the Manage Display interface of the utilised content type.

Let me know if that solves your question.

Kostas

Thank you very much Kostas. It seems to work, however i get only one field to filter “Title”. Under Structure -> Content type -> Job posting however i have about 10 fields available.

Is there a place where i have to set the fields that can be filtered ?

Maxime

Hey @mhutinet,

You can only combine fields that are already added in the fields section. Thats why in my previous comment I told you to “Force using fields”, since by default the fields are locked.

So just add fields in the fields section and they will appear in the “combine” interface.

Kostas

Hey @kplatis,

Sorry i didn’t see the “fields” part. Your advice worked. I added some extra fields and i can see them from the “combine” interface.

Now that i set the combine filter on two fields, i get this error : “Combine fields filter can only be used on displays that use fields. Set the style or row format for that display to one using fields to use the combine field filter.”.

I looked under Structure -> Content type -> Job posting -> Manage fields -> Manage display and the fields i try to look through are set as “default” for the Formatter section. What does the system mean by displays that use fields ?

Sorry to bother you about this :grimacing:

Thank you very much.

Maxime

Ok I had a look and it was a bit tricky.

The issue is that you added the filter for all displays of the view, including the Feed display, which does not uses Fields.

So just remove the filter for the Feed display only and it should be fixed.

General Tip for views

The issue was probably caused because you chose For all displays when you were adding the filter.

Use For all displays only when you are sure that you want the change to be applied for all the displays of the view and obviously its not always the case. For example this time you dont want the “Combine filter” to be applied in the Feed. So either add the filter per case or add it for all and remove it per case.

Hope this helps,

Kostas

It worked great !

Thank you very much.

Maxime