As a developer have you tried to create a condition or context requirement for requiring the User from the route only to find it does not exist? That is because Drupal core only provides a user context for the current user.

This module will provide a context for getting the User object from the route if one is present (example, visiting /user/{user} for a user profile). This will also work for custom routes (/foo/bar/{user}/baz) if the parameter is set in the routing definition.

Conditions that include the user in its context_definition of the plugin class will see a new option on the condition form, one for Current User and one for User from URL. The latter will set the context against a User being viewed. This is useful for developing conditions that are used or executed on the User profile page or other routes where the user object is present.

Note that using this incorrectly may inadvertently display something you do not intend to show to users (depending on what you are attempting to do), so be sure to be explicit with your conditions, Contexts and testing.

Supporting organizations: 
Sponsored Development (Drupal 8/9)

Project information

Releases