• Resolved alexpi77

    (@alexpi77)


    Hello,

    I have some pages that are using the files field to allow entry of pdf files. I want to display those files using the Pods Item List block. I can’t figure out what to enter in the block options ‘Where’ field, to reference each page’s file field. I tried everything from this page https://docs.pods.io/code/pods/find/find-reference-table/, with no luck.

    • This topic was modified 1 year, 3 months ago by alexpi77.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @alexpi77

    No need to fetch the files using a Pods query.
    You can use a templates for this, example:

    [each file_field_name]
    Your HTML here, for example:
    <a href="{@_src}" target="_blank">{@title}</a>
    [/each]

    More info here: https://docs.pods.io/displaying-pods/magic-tags/using-magic-tags/

    Cheers, Jory

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    You may also want to specify which files are appearing, if it needs to be based on the current item (page) that you are embedding the block for, you should instead use the Single Item block. That block will allow you to reference the current item/page automatically.

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    One final note, if you are trying to list attachments that have no relationship field and on the page itself and were instead “attached” to the page, that’s when you would use a List Item block and choose Media as your pod (if you’ve extended it). Then your “where” would be: t.post_parent = {@post.ID}

    Thread Starter alexpi77

    (@alexpi77)

    The Single Item block with @keraweb’s template did the work. Thank you all.

    • This reply was modified 1 year, 3 months ago by alexpi77.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Display file list with Pods Item List block’ is closed to new replies.