Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Display image on defaultColumn

default discord avatar
clement6396last year
9

Hi, do you know if there is a way to display a preview image on my collection list?


Actually in Media collection, the field "filename" does it, but I can't access it with another collection (like Post articles).

  • default discord avatar
    notchrlast year

    @<Clement/> In post articles, you're just getting the ID back?

  • default discord avatar
    clement6396last year

    I think I got all the data, but since defaultColumn can accept only string, I can't access the filename





    it wont works

    image.png
  • default discord avatar
    notchrlast year

    You may be able to make a custom row / cell component



    https://payloadcms.com/docs/admin/components#cell-component
  • default discord avatar
    clement6396last year

    oh ok I 'll check right after, thx you

  • default discord avatar
    devaaravmishralast year

    How to access document within cells in list view?



    In order to display image via custom component.

  • default discord avatar
    danceringlast year

    Do you mean to show image related thumbnail like this?



    Captura_de_pantalla_2023-09-02_a_las_18.54.18.png
  • default discord avatar
    carlosbensantlast year

    Yes. I'm looking to display the image thumbnail, how did you do it?!

  • default discord avatar
    exposure_phillast year

    did you get this working?

  • default discord avatar
    carlosbensantlast year

    No. I didn't bother to get it working because I changed the implementation but if I remember well, while working on it, I found we might need to make a request to the server for every row/cell in the table where the image component is displayed to get the file object/URL as it's not populated in the current request. That was my assumption and I didn't like it, there should be a way to get the file URL in the current page request.

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.