Meta Box
Support Forum
Support › General › Displaying multiple files with line break instead of commaResolved
Hello, I created a simple metabox File Advanced field where a user can upload multiple files. However, I would like this to display as a list of items rather than "file1, file 2, file3,..."
Is there a simple way to accomplish this?
Thank you.
Hello,
You can follow the documentation below to use the code to output the field value https://docs.metabox.io/fields/file-advanced/#template-usage
then you can output the items in any list as you want. Here is an example
<?php $files = rwmb_meta( 'my_field_id' ); ?> <h3>Uploaded files</h3> <ul> <?php foreach ( $files as $file ) : ?> <li><a href="<?= $file['url']; ?>"><?= $file['name']; ?></a></li> <?php endforeach ?> </ul>
Many thanks!