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.
Hi,
assume we are looking at a user/% page. I want to show a block of friends (relations) for that given user %, excluding that user. This means I need setup a contextual filter. But the contextual filters only allow "requestee" or "requester" by URL id. So it's either/or, but you need both directions.
Feature request: add a contextual filter (argument) "requestee OR requester".
Comment | File | Size | Author |
---|---|---|---|
#6 | user_relationships-contextual-filter-1158714-6.patch | 3.17 KB | jessehs |
#2 | user_relationships-contextual-filter-1158714-2.patch | 3.16 KB | jessehs |
Comments
Comment #1
Nicolino77 CreditAttribution: Nicolino77 commentedI have the same request. This is important.
Comment #2
jessehsThis adds a contextual filter "requestor or requestee" that should allow this to be created.
You would also add a contextual filter to the view User: uid with the "Exclude" option checked in order to exclude the user from the view as well.
One caveat is that if this is a panels pane, its User: uid context can only be used for one argument in the view. To get around this, I set up the views pane's Argument Input options to be "Input on pane config" and on the pane config I set both arguments to be "%user:uid".
Note that I haven't tested, but this may depend on the patch here: https://drupal.org/node/409432#comment-8551703
Comment #3
jessehsComment #5
Nicolino77 CreditAttribution: Nicolino77 commentedJessehs, can you create a patch that passes testing? Thanks for your work!
Comment #6
jessehsThis patch applies against 7.x-1.x-dev. The previous patch was applied to a project that had a bunch of patches applied already (many useful ones too!) Here is a Drush Make file entry explaining all patches I had applied (including the one I posed above in #2):