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.

Customize the "create" view of a collection

default discord avatar
marclp_eslast year
3

I was wondering if the default "create" view for a collection can be edited in the same way that the "edit" and "list" views can be modified under admin.components.views

  • default discord avatar
    zed0547last year

    Hey

    @264760868254777344



    I'm about to blow your mind



    So, the "Edit" view

    is

    the create view



    The distinction that's used between create and update is

    if we have a valid document id or not

    You can easily get this yourself via a call to the

    useDocumentInfo

    hook



    If the id is present, you are in an update view, otherwise no id implies it's being created

  • default discord avatar
    marclp_eslast year

    Wow, That's pretty smart



    Thanks for the fast reply

  • default discord avatar
    zed0547last year
    If the id is present, you are in an update view, otherwise no id implies it's being created

    This is actually how Paylaod makes the distinction internally



    My pleasure my friend!

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.