Dynamic Gutenberg Blocks using the Query Loop & Advanced Custom Fields
Vložit
- čas přidán 5. 09. 2024
- Learn how to display and query dynamic data on your site using GenerateBlocks w/ Advanced Custom fields.
🧰 GenerateBlocks Pro: buildthatwebsi...
Easily build your own affiliate templates, product callouts, even custom coupons -- all populated with dynamic data from your Custom Post types and Custom Fields.
#wordpress #generateblocks #acf - Jak na to + styl
I use Kadence Pro and it allows mixing static and dynamic data in the core paragraph block, its own advanced text block and others. It also supports building templates using Kadence elements which could be used instead of a reusable block
That's Great Thank you for this amazing tutorial
You're very welcome, glad you enjoyed it!
It is frustrating that the native Query block doesn’t have a single post picker but I’ve gotten around this by simply using a keyword search parameter. That way you can pull in specific posts without any paid blocks. And then used the native Post Template block to setup your layout.
great video. love learning about gp/gb/acf.
Hi, I do have Generate Block Pro, and I can not see the field to choice in "Post Meta Fild" in 9:19 . Do I miss something?
Does anyone know how I can get the single post page to display in a popup when I click on a post in the loop grid?
Would you kindly share a reusable template to this? I will appreciate
This is as far as I've got in my search, but once you decouple it from the reusable block, what if you then need to adjust the design slightly? How are you handling that? or, for example, if you at a later date wanted to add another ACF field into your product blocks. That's what I am trying to work out :S
If you're building a structure using the query loop like we did in this video, then you could do it like this:
Have the outer block be a reusable block that holds the query loop and an inner reusable block that holds the template. When you adjust the query, you can convert the outer block to regular blocks but leave the inner reusable block untouched. That should allow you to change the template site-wide.
P.S. I enjoyed your tutorial on Bricks Builder. It helped a bunch when I first bought a license. It's a fantastic builder for the price. Currently using it to build an API-driven site powered by Airtable & ACF.
Correct me if I'm wrong, but are these premium plugins basically selling you the ability to show a custom database field within a loop? Because that feels like a core function that WordPress has somehow failed to include.
Well the free version can show basic text-based WordPress fields. The Pro version lets you work with multiple ACF field types. These are not the same as WordPress custom fields and required substantial development work to support.
How to present a list of elements ? When I try to add a list of multiple choice its not working.
You can't build a dynamic list of elements using tags using generatepress. If you need html lists you'd need to try something like crocoblock or toolset.
i think its cool what you're showing here but I would rather have all of the control in the block itself (in php) no need for query loop or things like that.
Sure, PHP is always going to be more flexible and powerful. However, 99% of WordPress users can't code PHP.
I assume they mean a custom-coded block in PHP / ACF. My issues with that is then there is no flexibility with the layout inside the loop (beyond what hardcoded config options you may have coded in). Also the editing experience of an ACF block isn’t ideal. These days, I get more excited about ways to do as much as possible within the block based and FSE system with just native blocks and patterns and as little custom code as possible… or maybe some block styles, variations, or filters added to native blocks.
Great tut dude. Any hacks for repeater fields ? :)
Crocoblock Jetengine can work with repeaters I think. I typically custom-code anything that needs repeaters or complex functionality.
@@BuildThatWebsite I know the paid methods too lol, I can code custom ACF blocks too.
I meant free hack, and I just found one! You can basically just set multiple fields upfront, lets say you have pros cons repeater, you can set 10 fields upfront (GenerateBlocks Headings) and then just the ones that are pupulated will show up.
So you kinda have to set everything upfront and add more blocks than necessary for it being semi-future proof. But it works.
I even added repeater fields nested inside other repeater fields. Works like a charm.
P.S. Tom Usborne is a saint. I have yet to find a solo developer that offers so much for free. Cause GenerateBlocks functionality is no joke. Right now you can do sooooo much with just ACF and GenerateBlocks. Simply amazing.
Hi, any idea how to make filters for query loop? free option please. thanks
I'm not aware of any free plugins that can do this. If you do find one, I'd love to hear about it.
@@BuildThatWebsite what about using "pods" plugin to create ACF?
I want query loop data in table design
It is possible?
It may be possible with a 3rd-party plugin. I found this with a quick Google search: barn2.com/kb/list-wordpress-custom-post-type/.
There may be other options as well.