- This topic has 5 replies, 2 voices, and was last updated 3 years, 5 months ago by
Fernando.
-
AuthorPosts
-
November 21, 2022 at 6:58 pm #2426454
Justin
In summary, I’m trying to use a reuseable block within a GPblocks query loop.
To start, I created a GPBlocks query loop and then set its taxonomy to a posts category. I then made the grid within that query loop a reusable container. My goal is to create a blank GP query loop on future pages that has a different posts catagory, but then add the reuseable block grid to control styles globally across my site (if needed in the future). In other words, the query loop controls what posts appear in the grid, and the “child” reuseable block controls the styles that appear in the grid.
It actually works in the WP editor, but not in my staging site. Subsequent pages where I add the reuseable block show posts from the first page where I created the reuseable component.
Here’s the page where I made the reuseable block (staging user/pw: dev/dev)
Here’s a page where I tested adding it to a new, blank query loop. (staging user/pw: dev/dev). There should only be one article that appears in this query loop (and it behaves properly in the editor), but it shows post assigned to a different category when I publish and check on my staging site.
Thanks in advance for any insight you can provide.
November 21, 2022 at 7:24 pm #2426471Fernando Customer Support
Hi Justin,
Try placing everything under the Post Template Block inside a Container Block, and then make this Container Block the one that’s reusable.
November 21, 2022 at 11:16 pm #2426656Justin
Thanks for the quick reply! (We’re so impressed with your support)
I got this to work after clicking around enough, but by doing this, you lose all the layout and spacing settings for the Post Template block. You also lose the layout settings for the Grid block.
Was that your experience as well? Perhaps I’m missing something?
November 22, 2022 at 1:04 am #2426722Fernando Customer Support
Yes, that’s natural. We just made the content of the Post Template Block the one that’s Reusable.
You’re not missing anything. Making the Grid Block or Post Template Block the reusable Blocks, causes issues for the Query Loop Block. As this is a WordPress Block, how it functions would be out of our scope.
We usually advise our customers to use the Local Pattern feature of GenerateBlocks Pro. Reference: https://docs.generateblocks.com/article/pattern-library-overview/
However, Local Patterns already added do not update automatically as would a Reusable Block. It’s meant to work just as a “Pattern”.
November 22, 2022 at 10:42 am #2427767Justin
That makes sense. Thanks again for the quick replies.
November 22, 2022 at 5:06 pm #2428109Fernando Customer Support
You’re welcome, Justin!
-
AuthorPosts
- You must be logged in to reply to this topic.