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.
I wanted to add a contextual filter on a view using the "Content Type" field. Using a Filter is possible, but using a Contextual Filter seemed to be missing.
Attached a patch, that adds the missing part.
Comment | File | Size | Author |
---|---|---|---|
#3 | 2844527-3--add_contextual_filter_definitions.patch | 1.28 KB | drunken monkey |
|
Comments
Comment #2
ayalon CreditAttribution: ayalon at Liip commentedComment #3
drunken monkeyThanks a lot for reporting this!
You're right, no reason not to just use our default contextual filter plugin for content types, too. Also seems to work fine in practice.
However, looking at that function, it seems we can add that plugin for some other of our types, too. Really, the only one where the normal plugin won't really work is
date
, I think.Please test/review the attached patch and I can commit it!
Comment #4
ayalon CreditAttribution: ayalon commentedThx for the patch, works as expected.
Comment #5
ayalon CreditAttribution: ayalon commentedComment #7
drunken monkeyGood to hear, thanks for testing!
Committed.
Thanks again for your report and patch!