1.3.7 Beta - Bricks query loop with ACF repeater field

Installed the beta version for testing if we can use query loop with ACF repeater fields. Wasn’t able to figure out.
Have created a simple ACF repeater field where an image and text is repeated. i.e Team member name and photo. How to fetch & render this data in Bricks builder?

1 Like

Hi Dushyanth,

ACF or other dynamic repeater fields are currently not supported within the builder but are already on the Idea Board.

In the meantime, you can use the code block element inside of the query loop to render your repeater fields. This requires custom code but works like a charm.

Best regards,
timmse

cool, thanks timmse…
will try adding a custom code block for now

Hi timmse,

Are you suggesting to make a container with query loop on and put a code block under it (nested)? Code should output the acf field?

I am trying to achieve a similar solution with Metabox Group. I want to output the group (repeater) fields as grid boxes. I have code right now which outputs all the items but as a single item. I wish to use Bricks accordion with Metabox repeatable items. I am posting my code for your reference. If you can direct me or give me some suggestion then it will be really helpful.

function repeatme() {

$group = rwmb_meta( 'repeatme', ['storage_type' => 'custom_table', 'table' => 'camp'] );
if ( empty( $group ) ) {
    return '';
}

$output = '';

foreach ( $group as $sub_group ) {

    // Sub-field Class.
    $groupclass = $sub_group['day'] ? $sub_group['day'] : '';
    $output .= '<h3 class="my-title">' . $groupclass . '</h3>';
  
    $grouptwo = $sub_group['activity'] ? $sub_group['activity'] : '';
    $output .= '<h3 class="my-title">' . $grouptwo . '</h3>';

}      
  
return $output;

}

I want to use day as accordion title and activity as accordion inner content for example.

Hi Omega,
Welcome to the forum!

You can place a code block inside the query loop and manually render the currently non-supported fields, sure.

Using an accordion is a bit more complicated because you need to build the accordion manually as well, which means you can’t use the accordion element, but make use of its functionality.

An alternative to the Bricks Accordion might be the HTML details tag.

Best regards,
timmse

1 Like

Thank you! :slight_smile:

I went with you HTML details tag suggestion. It is outputting as I want. I will do some styling and call it a day.

PS I am not sure if it’s bug or anything. But no code is outputting under a container (query loop). Any example you have to try out?

Also is there any table block in Bricks? I want my client to be able to enter some data in table on regular basis. I noticed there is a table block in Gutenberg but not sure how to do placement. so client can edit on all single pages if any changes etc. Any idea how to go about this? Custom fields is an option but I don’t want to bloat the post postmeta tables.

Not yet unfortunately but a much needed basic addition - It has been posted on the ideas board so be sure to give it a vote - https://bricksbuilder.io/ideas/#3674

1 Like

You’re welcome!

The dynamic data option of the code block is limited (or rather the execution). If you use custom PHP and set the code block to execute, your custom fields should show. If not, there is probably a problem with your code.

Currently not, but it’s already on the idea board: https://bricksbuilder.io/ideas/#3674
As you already said, the alternatives are custom fields or a table plugin.

Best regards,
timmse

1 Like

Has this idea been implemented yet? I still can’t output ACF Repeater fields!

Hi

yes, ACF repeaters are working since some time now. I could not implement my page without them.

Cheers

Patric