Automattic / newspack-blocks

Gutenberg blocks for the Newspack project.
198 stars 41 forks source link

Homepage block: allow tag/category filters as either AND or OR #856

Open gamebits opened 2 years ago

gamebits commented 2 years ago

The Homepage Block allows the selected posts to be filtered by tag (https://github.com/Automattic/newspack-blocks/pull/297), category (https://github.com/Automattic/newspack-blocks/pull/821), author (https://github.com/Automattic/newspack-blocks/pull/60), or co-author (https://github.com/Automattic/newspack-blocks/pull/836). When more than one tag/category/author/co-author is selected, the block pulls in posts that contain any matching criteria.

We've had a request to make this filter work as AND instead of OR — i.e., the block pulls in posts that contain all matching criteria.

I confirmed the current functionality is OR in this screenshot, which selected all three posts; if it were AND, only one post would've been selected.

homepage-block-filter

Clearly we don't want to universally change this behavior for all publishers, but a toggle that lets the publisher choose the desired behavior would be welcome.

gamebits commented 2 years ago

Ths feature was originally requested by OSM. Berkeleyside has now also requested this feature. More details in Slack: p1630620079096000-slack-C015W6BES8J

gamebits commented 8 months ago

See also 1200550061930446-as-1203510053720585

stature commented 7 months ago

Block Club Chicago has now also requested this feature. More details in Slack: p1701461156644649-slack-C011YNC4B24