-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Term Query Loop Block #49094
Comments
+1 on this. It's a very common pattern for themes that we can't really work around right now. A good example is the section By Topic on Blue Note, a community theme currently in development: WordPress/community-themes#5 |
This comment has been minimized.
This comment has been minimized.
@scruffian you've misunderstood, this issue is not about displaying posts in a term, it's about displaying the terms themselves! E.g. it would not produce a post list, it could produce a tag list like this: ![]() Or more complex items, e.g. a heading with a read more button underneath with a term description |
This comment has been minimized.
This comment has been minimized.
+1 this! Are there any updates/decisions made about adding this new block? |
We want it, we just need someone to build it! |
Noting that this will need scoping out by an engineer to figure out exactly what needs to be done, it's not as simple as asking for it to be done then someone doing it. For example, issues for at least these blocks would need to be created:
People can probably think of more such as a term slug block but these seem to be the MVP, and each of those will require its own issue and dependencies. I can also see API changes being desirable re: variations. Afterall if you use a category loop you don't expect a term template, you expect a category template, and a category name/title, making those blocks dependent. There's also the possibility that because the terms are different entities that it might require taxonomy specific blocks be registered or variants for each taxonomy so that they know which entity type to access and can display the right information. For those versed in agile, this is more like a spike than an implementation ticket, help/contributions needed for specification |
This is pretty straight forward to answer. Unless you see PRs mentioned here then there has been no work done to build this. If you can't see any decision making then that means no decision making took place. If there were a place were decisions were made related to this that didn't filter down it'd be the public weekly editor meetings, but someone would have to raise it on the agenda, and it's highly unlikely the info wouldn't filter over to here. Unless someone made another issue and that one got traction instead. |
Punting to 6.5 for consideration since we're four weeks away from beta 1. |
Punted for the same reason as before. This is going to take intentional effort to get done so if anyone is interested for 6.6, please speak up! |
I'm working with term meta and terms for the first time in several years (or ever?) and came across this issue while reviewing what capabilities exist in Gutenberg in order to find a block that would display all terms that exist for a particular taxonomy across an entire website. Even after some research about the current state of such a block; I was a bit confused and found this issue which heavily overlaps with #33302 (This is cross-posted in #33302 as well). I include some notes in case anyone else has the same issue or is trying to triage this issue: Categories block - lists all terms that exist for the taxonomy 'category' across an entire website. Post Terms block - lists the terms that are assigned for a taxonomy (selected in the attribute field) on a particular post or page If you register a custom taxonomy, a block variation for the post terms block is registered. Tag cloud - lists all of the terms that exist for the taxonomy "post_tag" across an entire website. There are a couple existing PRs #58033 & #26555 that modifies the categories block to select any taxonomy and displays all of that taxonomy's terms on the website. Going forward in the long-term: I think a new flexible block(s) would probably be appropriate as Tom described at #49094 (comment) There is a separate block under development - https://github.com/mattyza/terms-list-block but I haven't examined it. |
@skorasaurus has perfectly described what we and doubtless thousands of other developers need as well - a block that would display all terms which exist for a particular taxonomy. (Ideally with some straightforward way to modify the query being run by that block, so we could filter it by children of a particular term, etc.) It's baffling to me that custom taxonomies are such a fundamental feature of WordPress, people have been asking for some variant of this request for years, and yet resources are being spent to building a real-time multi-user version of Gutenberg or whatever instead of creating this block. For now we are probably just going to hack this up in PHP and punt on the template being block-editor-friendly, since in the old world this is basically just a call to get_terms() that takes two minutes to write. |
@aaroncommand he's only in charge of spending his own personal time that's contributed and volunteered here, there's no corporate decision delaying this from being built or product roadmap that punted this. For this to move forward what's needed is for an engineer to scope out what has to happen so that others know what to do and where to do it. Building this for a single client/customer is easier than making sure this gets built properly for core as tiny engineering decisions can have huge ramifications. Any support you can show will help here enormously even if it only answers part of the puzzle |
Hi folks, |
We cannot use Query Loop. We'd need to update some existing term blocks and add new ones. |
Came across this implementation of a Term query loop - elegant! |
@kauaicreative that's using the bricks page builder not Gutenberg |
Yes, bricks. I have not personally used Bricks - but the implementation may offer some inspiration:
|
@cr0ybot I'll gladly help review & test your solution in case you plan on bringing them into core 👀 really cool to see some movement here 🤩 |
@fabiankaegy Thanks! That would be really helpful. My approach has basically been to duplicate the Query Loop block and modify it to work with taxonomy terms. I also had to cut out a bunch of stuff for the sake of my own time, like the pattern chooser.
|
I have this plugin mostly working, https://github.com/cr0ybot/term-query I'm handling the display of term info/meta using block bindings, which is simultaneously cool and somewhat difficult to work with. I've added variations of the heading, paragraph, and button blocks to attach the appropriate block bindings, but obviously these blocks are not scoped to the Taxonomy Terms block only. Not quite sure if there's a better way of handling this sort of thing yet, but I'm definitely not making the same mistake I've made before by adding a bunch of custom blocks for what amounts to some text and links. |
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:
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:
The text was updated successfully, but these errors were encountered: