-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
What problem does this address?
Currently you can create a tag cloud, and there's a post term list, but these options are limited, and come in 2 versions ( one for the current post, and one that's just general ). If I need to build anything that deviates from this I'm forced to build a new block.
E.g. if I want to display terms with their term descriptions, or add a graphic next to each tag, sort terms into columns, etc, I can't do that with core blocks. Or even spread terms out in a row the same way a group/row block can.
e.g. creating this type of category list automatically is not possible with the core blocks:
Politics
News articles about politics
Sports
The latest sports news
What is your proposed solution?
Instead, A term query block similar to the post query block would be very useful, with term title, term description etc blocks.
This way the existing core blocks could be constructed in any shape form or layout by the users choice without writing code. E.g. using headings for tags with descriptions, custom term featured image blocks in plugins, adding icons, etc
Variants of the block could be registered for each taxonomy too:
Proposed Plan
We have a couple of working examples of how these blocks could work (Terms Query plugin and a draft PR). However, as this work introduces multiple new blocks, it will be easier to work on and review if the work is split up.
We can use the first container block PR as a base feature branch, and then split the work up as follows:
- Terms Query container block: Add Terms Query container block #70720
- Terms Template block: Add Term Template block #70747
- Terms Name block (either as a new inner block or a block binding on an existing block)
- Terms Count block (either as a new inner block or a block binding on an existing block)
Other features that could be follow-up PRs:
- Modify the term description block to render the preview
- Add variation picker and multiple layout variations
- 'Show only child terms' option
- Allow inheriting the terms query from the current template