Hello, Is there any way to add a button in custom field component to open the editor for related collection record?
are the items on the left represent the related docs on the right?
yes that's right
Since you have the data available already, you should be able to simply trigger the drawer using the
DrawerTogglerfrom
import { DrawerToggler } from 'payload/components/elements';.
Try something like this:
<DrawerToggler
className="btn btn--style-transparent btn--size-small"
slug={drawerSlug}
>
Edit
</DrawerToggler>Rebuild the link of the edit view and use it as the
drawerSlugusing probably the
id.
Btw, this is for Payload V2 not sure about Payload V3.
You could also check this video:
https://www.youtube.com/watch?v=B8nNqlREu5o

Thanks a lot! This 100% solved my issue.
Star
Discord
online
Get dedicated engineering support directly from the Payload team.