Views UI

Does your Drupal site feature user profiles that you want to show 'related content' on with different Views, only to find that "Load default filter from user page" does not exist?

This module allows you to create lists of users based on shared taxonomy terms in user profile fields.

This module overrides the plugin that manages this and adds user support. This will work for user profiles or any public route where {user} is a defined route parameter.

Now you can add several Views on a User page containing related content or related items within Drupal based on their taxonomy relationships to that User!

Installation

Install the module with Composer. You will find it in the admin under the Views category.

Usage

  1. Add a term reference field to your user
  2. Create a new User view with a block display
  3. Add a relationship for the term reference field
  4. Add a contextual filter for Taxonomy term: Term ID and configure it to use the relationship you just created
  5. Select Provide default value and choose Taxonomy term ID from URL from the drop-down box
  6. Check the box for Load default filter from user page, that's good for related taxonomy blocks and optionally limit the vocabulary
  7. Optionally, add a second contextual filter to exclude the current user from the views results
  8. Stick the new block in a region and make sure it displays on user/* URLs

This will also work in setups using Layout Builder, Acquia Site Studio or custom setups that define API routes, like "/api/v1/user/%user" in Views - and also works with Search API / Search API Solr based Views.

Supporting organizations: 
Drupal 9+ development

Project information

Releases