PDF / email template: List uploaded file names from within repeater field? #1566
-
Hi, I'm using https://verbb.io/craft-plugins/formie/docs/template-guides/pdf-templates. I have a repeater field ( How can I create a simple list with file names in the attached PDF template for notification? I tried various chatgpt suggestions, but did not get it quite right by now. 😉
Thanks very much in advance! Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I would suggest brushing up on how rendering submission content works as that'll guide you through most cases. But for your exact use-case: {% set rows = submission.getFieldValue('myRepeaterField').all() %}
{% if rows | length %}
<ul>
{% for row in rows %}
<li>
{% set assets = row.getFieldValue('myFileUploadField').all() %}
{% for asset in assets %}
{{ asset.filename }}
{% endfor %}
</li>
{% endfor %}
</ul>
{% else %}
No uploads found.
{% endif %} Keep in mind that a Repeater field is much like a Matrix or Super Table field, and a File Upload field is an Assets field. You'll notice the use of |
Beta Was this translation helpful? Give feedback.
I would suggest brushing up on how rendering submission content works as that'll guide you through most cases.
But for your exact use-case:
Keep in mind that a Repeater field is much like a Matrix or Super Table field, and a File Upload field is an Assets field. …