Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It's currently impossible to limit a node reference field with a view that contains a relationship, rather than the base table, providing the IDs. Adding an options form to references_plugin_style to optionally choose the ID field seems like a good way to make this more flexible.
Comment | File | Size | Author |
---|---|---|---|
#1 | id_field_alias_as_option-1285734-1.patch | 1.69 KB | sreynen |
Comments
Comment #1
sreynen CreditAttribution: sreynen commentedAttached patch adds an options form with a field selector. Choosing a field changes the value of $id_field_alias to the alias of that field, allowing node reference fields to be limited based on relationships in Views, not just the base table. I've only tested this on node references, but I think it should work the same on other references, as long as the selected field is the same ID type (e.g. don't select node IDs on a view used in a user reference field).