acf-builder
acf-builder copied to clipboard
ACF 6 repeater pagination not working
Hi there,
I've been using ACF Composer to create fields and generate blocks on a Sage site I'm working on. ACF 6 adds a useful pagination feature, which I've tried to use using the code below. It adds pagination, but it's broken. Here's a video highlighting the issue:
https://share.cleanshot.com/LZDMSf
->addRepeater('news', [ 'label' => 'News', 'min' => 1, 'button_label' => 'Add Section', 'pagination' => 1, 'rows_per_page' => 2, ])
Thanks!
@Alex-Hay Sorry for the delay I was traveling last week.
I'm not able to recreate the issue with ACF 6.0.2
I created a paginated repeater with the ACF UI directly, as well with code via ACF Builder and they both work identically.
https://user-images.githubusercontent.com/9717/195189571-59e5f72e-a2f4-4b96-94ef-f4b8aa3927f2.mp4
Here is the code I was using:
$group = new FieldsBuilder('ACF_Builder_Test');
$group->addRepeater('news', [
'label' => 'News',
'min' => 1, 'button_label' =>
'Add Section',
'pagination' => 1,
'rows_per_page' => 2,
])
->addText('title', ['label' => 'Title'])
->setLocation('post_type', '==', 'post');
acf_add_local_field_group($group->build());
If the latest version of ACF 6.0.2 doesn't work can you post more of the PHP code used for the field group? I can use that to try to recreate locally.