Custom Fields
Support MB Views Display multiple media files connected to a user

  • Creator
  • #22208
    Resolved Henri


    I've extended the User with an File Advanced field in which I connect multiple Media files from the library to the user. Now I would like to show that on a page, so I thought to use MB views for that. I've added the following code:

    {{ user.first_name }} {{ user.last_name }}
    {% for post in query.posts %}
    <li>{{ user.downloaded_files }}</li>
    {% endfor %}

    The first and last name are being displayed. However, for the downloaded_files it shows 'array'. It has 2 connected files, so I understand that it is an array, but how do I need to change the code so that the files are shown? Or is this not the way to accomplish my use case?

    Kind regards, Henri

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
  • #22210
    Long Nguyen


    Because the field file_advanced always returns an array when retrieving so we have to loop through the array to get items information. Here is the sample code:

    {% for item in user.downloaded_files %}
        {{ item.title }}
    {% endfor %}

    You can also click to Insert Field > Users > Custom Fields > File Advanced, to generate the code automatically. See

    For more information, please follow the documentation


    Hi Long Nguyen,

    Awesome, it works like a charm now. I finally found a way to do what I want with your plugin 😊 I've tried it with Pods and with ACF in combination with Beaver Themer and it didn't work. Now I'm able to it with just Metabox. Awesome 👍🏻

    Kind regards, Henri

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.