Score:0

How to make a views exposed filter select input populate with the appropriate options?

br flag

I have a views exposed filter based on an entity reference field. The field references nodes.

When I'm adding a node of a content type that has this entity reference field, the input populates with the appropriate options (nodes) based on the field configuration.

Now I want to expose a views filter based on this field. But when I configure the exposed filter, if I choose "Single filter" under "Filter type to expose", the filter is presented as a text input.

And if I choose "Grouped filter under "Filter type to expose", the filter is presented as a select input with no options except "Any".

I see there is a way to manually add options to the select in the views UI, but how do I get the select to automatically populate with the appropriate node options, just like the input I see when I am adding a new content items?

Drupal version: 9.5.1.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.