Display ACF Repeater

WordPress
April 06, 2023 01:27:55
Gderon
Topics: 4
Messages: 20
Hello,

I have trouble displaying the content of an ACF Repeater field correctly.
I've looked through your how-to forum, I've tried various things based on what I've read (see pictures), but the repeater field still doesn't display. Instead, I see the number of entries in this repeater for this particular dataset (3).

Can you point me to a solution?
April 06, 2023 03:36:32
E2Pdf
Topics: 7
Messages: 3617
Support
Hi,

It looks like it's missed code in your functions.php or it was not set the correct value.

1. You need to add code to your theme functions.php or as a PHP snippet: https://codeshare.io/vwDPe4

2. It must be used shortcode as:

[acf_repeater field="defunt_enf_min" post_id="[id]"]
Nom: [acf field='defunt_enf_min_%ROW%_nom' post_id='[id]']
Age: [acf field='defunt_enf_min_%ROW%_age' post_id='[id]']
[/acf_repeater]

* Be sure that you are using the correct field names.

** If you are using an "HTML" object, it's also recommended to set "Disable WYSIWYG Editor" and put the shortcodes directly to the "Value" via "Right Mouse Click" -> "Properties". See please screenshot attached.

If you will not succeed, let us know please, do you get any output from the shortcode:
[acf field='defunt_enf_min_0_nom']

If not, attach please some screenshots with your ACF Fields setup.

We remain at your service.

We would really appreciate your feedback at WordPress.org!
April 06, 2023 07:20:42
Gderon
Topics: 4
Messages: 20
Hello again,

I have placed the PHP snippet,
I simplified the names of the ACF fields
I placed and adapted the shortcode, but still nothing on the PDF.

I tried the simple shortcode, no result.
April 06, 2023 07:27:48
Gderon
Topics: 4
Messages: 20
I am very sorry for the duplicated answers....

I add a picture of the dataset.
April 06, 2023 08:45:00
E2Pdf
Topics: 7
Messages: 3617
Support
Sorry, it looks like our mistake, we missed the part of the shortcode in the iteration, it must be added post_id="[id]" attribute.

Can you try to update the shortcode to:

[acf_repeater field="defunt_enf_min" post_id="[id]"]
Nom: [acf field="defunt_enf_min_%ROW%_nom" post_id="[id]"]
Age: [acf field="defunt_enf_min_%ROW%_age" post_id="[id]"]
[/acf_repeater]

Or if your new name is "defunt_enf":

[acf_repeater field="defunt_enf" post_id="[id]"]
Nom: [acf field="defunt_enf_%ROW%_nom" post_id="[id]"]
Age: [acf field="defunt_enf_%ROW%_age" post_id="[id]"]
[/acf_repeater]

And single shortcode to:

Nom: [acf field="defunt_enf_min_0_nom" post_id="[id]"]
or
Nom: [acf field="defunt_enf_0_nom" post_id="[id]"]

It must work, but if it still will not work and it's acceptable for you, you can submit a support ticket with access details to WP Admin Dashboard so we can log in and do some additional tests: https://e2pdf.com/support/request

We would really appreciate your feedback at WordPress.org!
April 06, 2023 09:01:38
Gderon
Topics: 4
Messages: 20
It works! Or almost...

There is still a problem that I encounter outside the Repeater field.

I have the value of my first ACF field (which is text),
but the second field is a yes/no with a stylized presentation (see picture). (and I use several of them in my forms)
In ACF, the active value is 'Major', the inactive value is 'Minor'.
In the dataset, 2 entries are Major, one is Minor.
On the PDF, the 2 major entries display 1 and the minor entry displays nothing.

I feel that the problem is mine, but I have searched and searched on your site without succeeding in displaying correctly the values selected in the forms.

Thanks for continuing to help me.
April 06, 2023 10:54:34
E2Pdf
Topics: 7
Messages: 3617
Support
It's because ACF shortcode outputs "1" when the "True / False" field is "checked" and nothing when not. Currently, we didn't find any solution except adding a separate shortcode to modify its output. It seems there is no way to output "UI ON/OFF Text" with default shortcode additional attributes.

Here is an example: https://codeshare.io/r90LPY

After adding to theme functions.php or as a PHP snippet, you must be able to replace the shortcode on the "age" field as below from "acf" to "acf-toggle" to output UI Text:

[acf_repeater field="defunt_enf" post_id="[id]"]
Nom: [acf field="defunt_enf_%ROW%_nom" post_id="[id]"]
Age: [acf-toggle field="defunt_enf_%ROW%_age" post_id="[id]"]
[/acf_repeater]

We would really appreciate your feedback at WordPress.org!
April 06, 2023 23:49:45
Gderon
Topics: 4
Messages: 20
Hello again,

I must have made a mistake somewhere...

I added the PHP snippet, I modified the code in the template as you told me.
But the PDF doesn't show the value of the ACF yes/no field.
April 07, 2023 03:00:23
E2Pdf
Topics: 7
Messages: 3617
Support
Hi,

Can you please attach also a screenshot of the PHP snippet?

We would really appreciate your feedback at WordPress.org!
April 07, 2023 03:05:29
Gderon
Topics: 4
Messages: 20
Sure.
April 07, 2023 04:01:39
E2Pdf
Topics: 7
Messages: 3617
Support
Everything seems okay. Unfortunately, we need to debug the code. You need to submit a support ticket so we can log in and do additional checks: https://e2pdf.com/support/request

We would really appreciate your feedback at WordPress.org!
Get News and Updates
Our monthly newsletter keeps you in the loop, so you'll always be up to date with the latest news and updates about E2Pdf.
* You can update your email subscription preferences here.
All trademarks, service marks, trade names, product names, and logos appearing on this website are the property of their respective owners. The use of trademarks such as Formidable Forms®, Forminator Forms®, Gravity Forms®, JetFormBuilder®, WordPress®, WooCommerce®, WPForms® and others is solely for identification purposes (nominative use) and does not imply any affiliation, sponsorship, or endorsement by the respective trademark holders.
© 2017 - 2026, https://e2pdf.com

We use cookies to collect and analyse information on site performance and usage, to provide social media features and to enhance and customise content and advertisements. By clicking "Accept Selected", you consent to use of selected cookies according to our Cookie Policy.