How to display ACF Repeater sub-field image

WordPress
2 January, 2025 10:25:36
wdd
Topics: 1
Messages: 3
Hi there!

I am trying to use an ACF Repeater to print out the design shown in the image attached.

For now I am manually creating each section and aligning it to the relevant fields, which works but doesn't look great with the dynamic content lengths as it gets quite 'gappy'. As a workaround, I thought of using a HTML block and the acf repeater built-in shortcode, which works for the content but not for the image. Even inserting an <img> tag with the correct source doesn't seem to work, so I was wondering if you would be able to help please?

Thanks so much!
2 January, 2025 13:27:17
E2Pdf
Support
Topics: 7
Messages: 3377
Hello,

ACF shortcodes don't support directly outputting "image" fields. However, you should be able to retrieve the image fields using the e2PDF meta keys. The specific shortcode usage will depend on how your ACF field stores the images.

Here is a simple example: https://codefile.io/f/4t300QwiEk

As shown in the example, the shortcode can be used inside an ACF repeater as follows:
[e2pdf-wp key="repeater_[e2pdf-acf-repeater-index]_image" meta="true" attachment_image_url="true" size="full"]

* attachment_image_url="true" and size="full" convert the ID to an image URL (useful if the image is stored as an ID).
** repeater_[e2pdf-acf-repeater-index]_image is an edited version of the Visual Mapper shortcode, originally available as repeater_0_image. [e2pdf-acf-repeater-index] is automatically replaced with the repeater index.

Please also note that we are using single quotes for the 'src' attribute and double quotes in the shortcode tag itself.

We would really appreciate your feedback at WordPress.org!
3 January, 2025 09:25:18
wdd
Topics: 1
Messages: 3
Thank you!

I will give this a go and report back :)
4 January, 2025 12:38:51
wdd
Topics: 1
Messages: 3
Hi there

Thanks for your help.

I have tried the above and pasted my code below. Unfortunately, however, the image is not rendered; I just have a blank space. To test if it was the shortcode I pasted just that on its own and it correctly prints out the image URL.

<table>
[e2pdf-acf-repeater field="itinerary"]
<tr>
<td width="50%">
<p>[e2pdf-format-output filter="strtoupper"][acf field="day_title"][/e2pdf-format-output] [acf field="title"]</p>
[acf field="text"]
</td>
<td width="50%">
[e2pdf-wp key="itinerary_[e2pdf-acf-repeater-index]_image" meta="true" attachment_image_url="true" size="full"]<br/>
<img src='[e2pdf-wp key="itinerary_[e2pdf-acf-repeater-index]_image" meta="true" attachment_image_url="true" size="full"]'>
</td>
[/e2pdf-acf-repeater]
</table>

I have also tried closing the img tag and adding width and height attributes but still nothing.

Thanks
4 January, 2025 13:59:40
E2Pdf
Support
Topics: 7
Messages: 3377
Is it the local website? If yes, unfortunately, when using the "img" tag with the "src" attribute, images must currently be publicly available over HTTP from the internet. We are also working towards enabling support for images to work on non-public websites, but this feature is still just on our TODO list.

P.S. Just a note: your HTML is also missing a closing "tr" tag before [/e2pdf-act-repeater]
We would really appreciate your feedback at WordPress.org!
6 January, 2025 04:21:06
E2Pdf
Support
Topics: 7
Messages: 3377
Hello,

Just to note, an update is expected this week for the RC version, which will include 'test' support for rendering local images with "img" src tags. We will notify you with an additional message as soon as it is released.
We would really appreciate your feedback at WordPress.org!
7 January, 2025 02:59:42
E2Pdf
Support
Topics: 7
Messages: 3377
We’ve just released the major RC update 1.27.00, which includes the option to support local images. You can follow the steps to update here: https://e2pdf.com/docs/install#rc-version.

Please note that the local host should be able to resolve its own local domain name.

P.S. This is a major update, so please let us know if you encounter any issues after the update.
We would really appreciate your feedback at WordPress.org!