I am building a site in Drupal 10. I have created a View Block for displaying team members. Team Members have a field that is a taxonomy term (for what team they belong to), and a related context filter. The filter works in the "Preview" section of the View editor, properly displaying only team members in the specified team (by taxonomy term ID).

If I make a Basic Page and try to add the Team Member Block, the only configuration options available are # of results and "Display Title." I do not see any way to specify the context filter value. I have tried various configurations of the "specify validation criteria" menu. Selecting the "Content" validator only adds a dropdown box containing "None" and "Content" to the block configuration. Selecting "Taxonomy Term," "Taxonomy Term Name," or "Taxonomy Vocabulary" has no effect.

How can I configure the block such that I can specify the context filter value when adding it to the page? Because I am hoping to add this block to the same page multiple times using different filter values, there is no url parameter available for the filter.

  • 1
    Does this answer your question? Contextual filter with a block view
    – cilefen
    Oct 6, 2023 at 19:58
  • 1
    This is a more recent issue drupal.org/project/drupal/issues/2886116 where people have mixed results with your approach. You could try #20 using a contrib module to reference Views in a block type field that allows you to provide arguments.
    – 4uk4
    Oct 7, 2023 at 7:56
  • @cilefen unfortunately, there is no URL parameter at play here because I want to include this block in my page multiple times, but with different context filters. I will update the question! Oct 7, 2023 at 14:46
  • @4uk4 thanks, "Views Reference Field" looks interesting and might work out. I am limited by our platform on which contrib modules I'm allowed to install. I am thinking about just creating multiple block views with Fixed default filter values and adding the precise block view I want in each location. Oct 7, 2023 at 14:48


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.