Module Description
Views default_argument plugin to use values from the current page entity as default values for a contextual filter. Similar what the "Content ID from URL" default value is doing, except you can pull any field value from that content instead of just the ID (but also you're not limited only to nodes, all entity types are supported).
A simple example would be to use the tags from the current page node to feed a "similar content" block. Works for any content entity type as long as the entity is accessible as a route parameter using the entity type id as the route parameter name (i.e. most entity routes).
Installation & Usage
* Install as usual, no initial settings to set.
* Add a contextual filter to a view display
* Select provide default value from the "When the filter is not available" section
* Select "Field value from Current Entity"
* Select the Entity type and field name to use as the default value
* Additionally set options for an empty field fallback & multiple values handling
A simple example would be to use the tags from the current page node to feed a "similar content" block. Works for any content entity type as long as the entity is accessible as a route parameter using the entity type id as the route parameter name (i.e. most entity routes).
Installation & Usage
* Install as usual, no initial settings to set.
* Add a contextual filter to a view display
* Select provide default value from the "When the filter is not available" section
* Select "Field value from Current Entity"
* Select the Entity type and field name to use as the default value
* Additionally set options for an empty field fallback & multiple values handling
Module Link
Project Usage
310
Security Covered
Covered By Security Advisory
Version Available
Production
Module Summary
This module solves the issue of using values from the current page entity as default values for a contextual filter in Views.
Data Name
views_arg_entity_field