Add elements to collection page

default discord avatar
akacronos
10 months ago
5

I want to add some features to the collection page (not the create doc). Is this possible? (like a download button)

  • discord user avatar
    denolfe
    Payload Team
    10 months ago

    You can swap in your own components. It sounds like you may want a custom cell component (which shows on the list view). You can pair this with a UI field type if you don't want to replace it for one of your existing fields.



    https://payloadcms.com/docs/admin/components#cell-component


    You'd place this component under the field's admin -> components -> Cell property

  • default discord avatar
    akacronos
    10 months ago

    I don't want to add something to the list, I want to add a download button on the general page. Is this possible?



    something like this example, or maybe next to filters/columns

    Screenshot_2023-01-25_at_9.00.16_p.m..png
  • discord user avatar
    denolfe
    Payload Team
    10 months ago

    You are able to swap out the entire List view by passing the following configuration on your collection:


      admin: {
        components: {
          views: {
            List: MyCustomListView
          }
        }
      }


    Here is the default List view for reference:

    https://github.com/payloadcms/payload/blob/master/src/admin/components/views/collections/List/Default.tsx
Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.