Plugin Support
ying
(@yingscarlett)
Hi @starbuck ,
The Grid block nested in the Query loop block is not supposed to be a reusable block.
All the content inside the Query loop block is dynamically generated with different IDs. But reusable blocks have the same IDs, which means if you change anything to a query, the other queries might or might not change, it will cause an internal failure in the block itself.
If you want to create a reusable block for a Query loop, yes, you can, but if you want to make changes to the inserted reusable block, make sure you convert it to a normal block and duplicate the query loop. This is important as duplicating process generate a new set of IDs, which makes the query loop a new one, and then you can make changes to it without interfering with other queries.
Thread Starter
Tony G
(@starbuck)
Thank you, Ying. I think that helps. To be clear, the reason the blocks are structured like this is to link a consistent query loop with consistent output.
If I change the query, yes, I expect all attached/reusable instances of that block to use the new query.
If I replace Private Post List Wide (within the grid) with Private Post List Columns, yes, I expect all attached/reusable instances of that block to now display columns.
If I want to replace the query for one page, yes, the instance must be detached – though the output block would remain as the default, and that would still be a dynamic/reusable block unless it too is detached.
However, are you saying that there is a single grid instance across the reusable blocks and that a query on one page will affect the results on another page because they share the grid instance ID? That would be a problem!
I don’t understand how that could be. Is the code for these blocks cached among pages rather than being reprocessed on each page?
If this is the problem I will gladly remove the grid and query loop from the reusable wp_blocks and wp_template_parts. But that significantly limits our ability to take advantage of the great new reusability features in WP.
Thanks!!
Hi @starbuck,
The ID is for the Design/Layout, not for the Query. But I imagine using a WordPress reusable Block may cause such issues as well.
What we would recommend is using a Pattern and a Global style instead for your GB Query Loops. This is available only with GB Pro though. Reference:
https://docs.generateblocks.com/article/pattern-library-overview/
https://docs.generateblocks.com/article/global-styles/
Hi there! We haven’t heard back from you for a while now so we’re going to go ahead and set this topic as resolved. Feel free to open a new topic if you need assistance with anything else.