Views currently doesn't have Context Filter support for the publishing options for nodes. Specifically the Status, Promote and Sticky fields.
I get that these are bit fields that really don't *need* context filters for the purposes of URL handling, but it would be nice to have them for things like generating summary lists that show count totals in a facet like way.
Attached is a patch that adds context filter support for these fields. Additionally I've included an exported view (in the .txt file) that demonstrates the usage of these context filters (once the patch is applied).
Lemme know if I need to make any changes to it!
Comments
Comment #1
netw3rker CreditAttribution: netw3rker commentedI guess this isn't so much of a feature request as it is a bug report (node options should have context filters, but they don't exist).
Comment #2
bryanbraun CreditAttribution: bryanbraun commentedThe patch applied cleanly for me, and everything worked as expected. Nice work!
Comment #3
kybermanGreat, it works fine. Thank you. But in case of "Provide default value" with "PHP code", you need to return 1/0 instead of true/false. Otherwise it returns 404.
Comment #4
netw3rker CreditAttribution: netw3rker commentedchanging status...
Comment #5
netw3rker CreditAttribution: netw3rker commented8.x port. Moving to Drupal core's views queue. The Handling of on/off labels is different in the 8.x patch than the 7.x patch. I'm going to rework the 7.x patch to be inline with the way 8.x handles things. That should reduce the 7.x patch size a bit.
Anyhow, hopefully this will get things moving :)
Comment #7
netw3rker CreditAttribution: netw3rker commentedThats what I get for removing cruft inside the patch.. one day I'll learn. Lets try again.
Comment #8
netw3rker CreditAttribution: netw3rker commentedComment #9
dawehnerSounds like a good idea in general! Thank you for your patch. Sadly this patch will need a reroll, and maybe some tests.
Comment #10
jrabeemer CreditAttribution: jrabeemer commentedCan this be two patches/tickets? One for D7 and one for D8?
Comment #21
kyberman