Use Page Number as Index in Dynamic Field

Forminator Forms
14 January, 2025 13:42:38
recuniforms
Topics: 4
Messages: 21
I've created a Forminator Form and am now using the responses to create a PDF in E2PDF. The form has repeater fields and I can reference those using the index value in the tag:

{text-11:1}

I'd like to use the page number as the index value so that I can paste what I create on Page 1 onto Page 2 and have the repeater values change. I've tried a number of things, but this is the idea:

{text-11:[e2pdf-page-number]}

The above code looks like {text-11:1} in the preview. But when exported with the real values, it returns nothing.

Any help would be greatly appreciated!
14 January, 2025 23:21:02
E2Pdf
Support
Topics: 7
Messages: 3377
Hello,

Unfortunately, the [e2pdf-page-number] shortcode cannot be used as part of the field slug. The value must be predefined for each page.
We would really appreciate your feedback at WordPress.org!
15 January, 2025 04:27:22
recuniforms
Topics: 4
Messages: 21
Thank you for your response.

Do you suggest any workarounds?

Or do you have any suggestions for editing the index number of a large number of slugs? I will be updating ~90 slugs on 50 pages (~4,500 slugs).
15 January, 2025 04:39:56
E2Pdf
Support
Topics: 7
Messages: 3377
Unfortunately, if each page is designed separately, there is no easier way to set it up. Extending functionality to work with repeaters is on our TODO list, but there is no ETA yet. However, as an alternative, you can try building the "page" repeater content using a single HTML object.

This approach makes it possible to iterate and create new pages automatically when using the "Multipage" option.

For example, the following code can be used:

https://codefile.io/f/nuWX8JmK4M

Additionally, it is recommended to enable the "Disable WYSIWYG Editor" option for better control over the HTML structure and to avoid reformatting.
We would really appreciate your feedback at WordPress.org!
15 January, 2025 04:44:04
E2Pdf
Support
Topics: 7
Messages: 3377
A screenshot is attached for reference:
We would really appreciate your feedback at WordPress.org!
15 January, 2025 05:01:21
recuniforms
Topics: 4
Messages: 21
Thank you!

It is only returning the value for the first index. Here's the code I used:

{foreach:group-3}
<div style="page-break-before: always;">
<h2>Unique Page Content</h2>
{text-11}
</div>

It's only outputting the value for {text-11:1}.

As a test, I have another place on the page that is outputting {text-11:2}.
15 January, 2025 05:04:53
E2Pdf
Support
Topics: 7
Messages: 3377
Could you please attach a screenshot showing the "Value" and other options configured for the "HTML" object?

Was the "Multipage" option checked?
We would really appreciate your feedback at WordPress.org!
15 January, 2025 05:13:30
recuniforms
Topics: 4
Messages: 21
Image 1: The new HTML properties as suggested.
Image 2: The template.
Image 3: The output.
Image 4: Output showing {text-11:1}{text-11:2}{text-11:3} (all from group-3).
15 January, 2025 05:28:00
recuniforms
Topics: 4
Messages: 21
Ultimately, here's is what I'm trying to solve for ...

This (attached) is messy and and a work in progress (all the cells in the table will have slugs with index numbers). I'd like to build it out on Page 1 and then find a way to have Page 2 be the same but change the index value for each slug from 1 to 2; and then repeat that for 50 pages.

Thanks so much for your help!
15 January, 2025 05:32:35
E2Pdf
Support
Topics: 7
Messages: 3377
Don't you get other pages with "Unique Page Content" and different values? It should duplicate the page and generate a new page for each repeater value. We just tested it on our side, and it appears to work as expected.

The last "image" field seems entirely unrelated to the HTML object that has been configured.

Could you please download and attach a backup of your E2Pdf Template? You can find the instructions here: https://e2pdf.com/docs/templates/backup. If you're unable to attach the backup to this message, please send it to [private].

P.S. Please note that this functionality would work only in the E2Pdf with the Paid License Key.

P.P.S. From the screenshot, it seems like the layout you’re trying to accomplish should be achievable. All the content with dynamic values needs to be placed within the "foreach" loop.
We would really appreciate your feedback at WordPress.org!
15 January, 2025 05:42:40
recuniforms
Topics: 4
Messages: 21
Correct re: image 4. I was just showing that there is content in {text-11:2}. Sorry for the confusion.

I just emailed you the backup as it would not allow me to attach a file of that type here. I have a paid license.
15 January, 2025 05:48:39
E2Pdf
Support
Topics: 7
Messages: 3377
The value is missing closing {/foreach:group-3} field slug.
We would really appreciate your feedback at WordPress.org!
15 January, 2025 06:00:42
recuniforms
Topics: 4
Messages: 21
Doh! Of course that worked ... ! Thank you! I will try to recreate my template in HTML so I can add it as a single HTML field. Is there any way to use your template builder and then somehow extract the HTML for the page as a whole?
15 January, 2025 06:04:51
E2Pdf
Support
Topics: 7
Messages: 3377
Unfortunately, not yet. The HTML needs to be designed manually.

P.S. We recommend using "tables" to build the layout in case you need to left / right elements as currently float positions are not supported.

P.P.S. It is also highly recommended to TURN ON the "Disable WYSIWYG Editor" option. If this is not checked, the incorrect HTML structure might be reformatted upon saving.
We would really appreciate your feedback at WordPress.org!
15 January, 2025 06:06:33
recuniforms
Topics: 4
Messages: 21
Thank you for all your help!