tomusborne / generateblocks

GenerateBlocks is a small collection of lightweight WordPress blocks that can accomplish nearly anything.
https://generateblocks.com
195 stars 19 forks source link

Feature: Looper Block #1218

Closed iansvo closed 1 month ago

iansvo commented 6 months ago

Fixes #967 #1061

This PR adds a new block: Looper. This block is based on some work @tomusborne did previously and I made a few adjustments and optimizations.

Dev Tasks

Changes

Next Steps

iansvo commented 6 months ago

@tomusborne Us waiting to retire the Query Loop block like

image

iansvo commented 5 months ago

@tomusborne So far I think the last thing remaining is cleaning up the attribute names so they make a bit more sense and we're not using a wpQuery attribute. I think we need to keep the attributes the same in a few places to avoid compatibility problems with the Query Loop block, or else namespace these context values differently.

Definitely super close to having this done, but I think this needs to happen first before we merge so we're not stuck with that super specific attribute.

tomusborne commented 5 months ago

Cool, clean up time - let's make sure we're not holding on to any baggage here that we don't need to.

Then we can look at how extendable it is for things like nested loops, ACF integration etc..

tdrayson commented 5 months ago

Would love to see the ability to query other things like taxonomies, users etc alongside nested loops too.

iansvo commented 5 months ago

Would love to see the ability to query other things like taxonomies, users etc alongside nested loops too.

This is something that we're going to tackle in future iterations of the new block. It's absolutely on the roadmap. One thing we're specifically interested in is a proper ACF integration, but in general we want this to be as multi purpose as possible.

tomusborne commented 5 months ago

@iansvo Are you able to get the loop to load on the frontend?

Also, the WP_Query SelectControl - should it display if it only has one option? Maybe we need a filter here to add more options, but the select only shows if there's more than one.

iansvo commented 5 months ago

@tomusborne Both things are resolved in my latest push. I had a few instances of the old context/attributes I missed and I updated the queryType to just be filterable like you said.

SchneiderSam commented 5 months ago

JetEngine User here 🙋‍♂️ hope this will work also for JE!?

iansvo commented 5 months ago

JetEngine User here 🙋‍♂️ hope this will work also for JE!?

Our first-class integration is going to initially be with ACF, but we will be exploring ways we can allow folks to filter things and effectively use whatever query source they can think of. But we'll have to see how that all looks as we develop. We want to introduce flexibility without a bunch of technical debt, so that's going to require some experimentation.

tomusborne commented 1 month ago

This code has been ported into new blocks in 2.0. Closing this.