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.

Custom message when delete item from collection

default discord avatar
agolovanlast year
1

How could I put a custom message for Confirm Deletion for certain collection? The standard message is You are about to delete the Tag SEATTLE. Are you sure? i could change a color, but is there a way to update text?

  • discord user avatar
    dribbens
    last year

    I don't know how you would do it for a specific collection. The language files can be overwritten, but it would replace it in every delete modal, not just your Tag collection.



    Thinking about how I might do this, you may be able to do it with custom CSS ::after to add content. The part I'm unsure of is if you'll be able to find selectors for the collection being deleted.


    https://developer.mozilla.org/en-US/docs/Web/CSS/::after


    A simple enhancement we could make is making sure you have the needed classes or ids that would allow you to do this.



    Another way about this is we could expose a new config property that would allow you to do this. I have a proposal for custom actions which isn't priortized atm, but in the future it could be used to replace built-in components in Payload on a per-collection basis:


    https://github.com/payloadcms/payload/discussions/2755
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.