e2pdf-download for each row in a repeater field

Bug Released
1 May, 2024 00:22:17
Vernon
Topics: 2
Messages: 6
I have a repeater field stored in wp_usermeta. I'm able to use the following to successfully get data from the first repeater field to populate and create the populated PDF template for download/view.

[e2pdf-user key="accreditation_details" path="item-0.accreditation_date" meta="true"]

What I want to do is have a download button for each item in the repeater group. I've tried various combinations of trying to pass arg1= index to the form, but haven't been successful. Can you please help me with the correct approach to replace the "item-0" with item-X where index would be the element offset in the repeater field?
1 May, 2024 01:57:04
E2Pdf
Support
Topics: 7
Messages: 3188
Hello,

Can you try please:

1. Setup your shortcodes as follows:

[e2pdf-download id="1" arg1="item-0"]

[e2pdf-download id="1" arg1="item-1"]

etc...

2. Inside the E2Pdf Template use the construction as follows:

[e2pdf-user key="accreditation_details" path="[e2pdf-arg key=arg1].accreditation_date" meta="true"]

3. You must be able to prevent empty PDF download link generation by using "Global Conditional Logic", see please the screenshot attached.
We would really appreciate your feedback at WordPress.org!
1 May, 2024 03:41:06
Vernon
Topics: 2
Messages: 6
With the template values set as depicted in the first screenshot.
And called with the first screenshot, and called using the shortcode as depicted in the second screenshot, I get the results in the PDF as depicted in the third screenshot.

Seems like the [e2pdf-arg key=arg1] when embedded inside the [e2pdf-user ...] isn't begin resolved.

I also tried with single quotes around key='arg1' and got the same result.
1 May, 2024 04:19:21
E2Pdf
Support
Topics: 7
Messages: 3188
Thank you for the detailed screenshots. We could replicate the issue and it was marked as a bug.

A fix in the RC version 1.23.29 was already released. Please update the plugin to the latest RC version by following the steps here: https://e2pdf.com/docs/install#rc-version

P.S. The current RC version also has simplified "arguments" shortcodes support and it must be possible to use: [e2pdf-arg1] instead of [e2pdf-arg key=arg1] inside the E2Pdf Template.

Please, let us know if you still have issues after the update.
We would really appreciate your feedback at WordPress.org!
1 May, 2024 04:42:21
Vernon
Topics: 2
Messages: 6
Working great! Thanks!
1 May, 2024 09:46:00
Vernon
Topics: 2
Messages: 6
In the forum I see a couple of references to using a custom shortcode to pass dynamic variables. For example the topic “Ultimate Member profile page download pdf link”. Unfortunately it seems like the codefile.io examples are no longer available. Can you please provide a new example?

In my case I’ll want to pass the offset in a series of rows to populate the arg1=“item-{index}”.


Thanks in advance!
1 May, 2024 10:20:11
E2Pdf
Support
Topics: 7
Messages: 3188
The topic is still available:

https://e2pdf.com/support/desk/ultimate-member-profile-page-download-pdf-link.

We can access codefile without any issues: https://codefile.io/f/W1hvSclxhN

P.S. The latest RC version also has extended users support, where you can connect the E2Pdf Template to the "WordPress" -> "Users" if you need just the data from the user, which is more correct. In case of connection to "WordPress" -> "Users" the code will be as follows: https://codefile.io/f/FiuH1GEJbm.

P.P.S. The example for the Ultimate Member, and um_profile_id() returns the User ID.
We would really appreciate your feedback at WordPress.org!
1 May, 2024 23:06:40
Vernon
Topics: 2
Messages: 6
Interesting. Seems like codefile.io doesn't work on mobile devices. Accessing the same URL on my iPhone shows an empty unnamed file. (Screenshot attached if interested.)

I'm just capturing this here in case someone else experiences the same situation.