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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ayalon created an issue. See original summary.

ayalon’s picture

drunken monkey’s picture

Component: General code » Views integration
Category: Bug report » Feature request
Status: Active » Needs review
FileSize
988 bytes
1.28 KB

Thanks 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!

ayalon’s picture

Thx for the patch, works as expected.

ayalon’s picture

Status: Needs review » Reviewed & tested by the community

  • drunken monkey committed 47500fa on 8.x-1.x authored by ayalon
    Issue #2844527 by ayalon, drunken monkey: Added some contextual filters...
drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Good to hear, thanks for testing!
Committed.
Thanks again for your report and patch!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.