Skip Navigation

[Resolved] Outputting file meta with repeating fields

This support ticket is created 7 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Author
Posts
#458432

I am trying to: Output file metadata (Title or alt text) for repeating file field

I expected to see: Some way to display different info for each repeating field

Instead, I got: Same title for all files.

Currently in my content template, I'm using this for outputting repeating file fields:

<h3>Addenda:</h3>
<ol>
[wpv-for-each field="wpcf-addenda"]
<li>[types field='addenda' link='true' title='Addendum' separator=''][/types]</li>
[/wpv-for-each]
</ol>

Result:
1. Addendum
2. Addendum
3. Addendum
...

Is there any way to include file meta in the foreach loop?

What I'd like to see is:

1. Addendum - 18 November
2. Addendum - 20 November
3. Addendum - 21 November
...

Where the date is the file upload date OR just output the title meta from the file (I could have the user edit the title when they upload the file).
I read in the documentation about using an index for repeating files, but that just talks about outputting ONE of the array.

Thanks for any help

#458675

Well, you display the same field for all iterations, so it's expected to get the same output for each.

Anyway, it is not possible to give a Multiple (repeating) Field type's items separate Titles or similar.

There was a request in regard, I added your voice there, and it has been considered, but I have no ETA for this.

A Custom Solution is visible under the below link:
https://toolset.com/forums/topic/print-out-file-name-in-view-template/#post-34741

I do hope this helps for now, and please let me know if I can be of assistance otherwise.

#460227

Hi, I am having the same question - would be nice if you can add one voice more to this request list...

Thanks and regards

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.