Query loops and ACF

I’m creating a site that will be using custom post types and ACF for a card game, using it to list cards in this game and their various properties. That includes things like the set it was in, the color of the card, certain types, power rating e.t.c. Think pokemon.

I’d like to do a few things with this site and wanted to know if this is possible with GB/GP, I’m using pro/premium for both.

I’d like to be able to create one single page that lists all of the custom posts, but then make it possible to filter by various different ACF fields. i.e. search by text, or select tick boxes for specific sets or multiple sets of a type, or for ranges of powers e.t.c

1 - Is this possible to create a query loop block template, then being able to select the attribute/s from the post meta/ACF to filter?

2 - Could I build a post loop query template, then create one page per set of cards, then just pull and display the data for that set based on the current page name or similar?

3 - On the singular card details page, can I make the currently shown post meta into a link, based on the currently shown data? i.e. this card is from the set “Red”. It’s easy to display, but can I code something that goes to https://sitename.com/cards/dynamicallypulleddata/ which would in this instance be Red?

4 - I’d like to be able to create one single page that lists all of the custom posts, but then make it possible to filter by various different ACF fields. i.e. search by text, or select tick boxes for specific sets or multiple sets of a type, or for ranges of powers e.t.c - I’m guessing this isn’t a feature yet, has anyone been able to use Generatepress/blocks with ACF and Filter Everything like in this video? Advanced Custom Fields ~ Powerful & Free Filtering Tutorial - YouTube

Currently I have just a page set for all cards, but with a query loop showing all cards. It doesn’t seem like there is a way to filter by an ACF field, and I’d have to use custom post types categories/taxonomies for now and filter by them. Is there a way of building a shortcode for this?

5 - I also can’t seem to build a query loop inside a hook and display it within a page. I have to build to query loop directly into the page, am I missing something?

6 - I’d also like to create a shortcode/function that displays data from ACF but in generateblocks, is that something that is fairly easy to do? I’ve already created a local Pattern with an image and a headline using dynamic data with the source blank. But then to display this in a post, I have to select the specific custom post for both the image and text. Is there a way I can select the post once and have the relevant data shown for that card, similar to a query loop?

Could anyone from the GB team jump in? Mainly wanting to know if GB post loops can work as a template/hook and call in data from acf based on a defined variable, or possibly from the page title?

Hi @odv,

  1. It’s not possible right now, but it’s something being considered as a feature in the future.

  2. There’s a Loop Template in GP Premium. You could try that.

  3. It’s possible but you’ll need a custom code for this.

  4. It might be good to ask this in the Facebook group as well: GeneratePress Community | Facebook

  5. You can use a Block Element to add it to multiple pages.

  6. It depends on the type of custom field. If you set the source to “Current post” that should work.