#Exclude UI typed Field from Sorting/ Editing

5 messages · Page 1 of 1 (latest)

last niche
#

I used the field type "ui" for inserting a small button to link to the page that is currently edited. Unfortunately this field also appears in the sorting or editing context although it is empty. Is there a way to tell payload no ignore the field also for the database?

violet grove
last niche
# violet grove Our form hooks should be all you need to do this inside of your custom UI compon...

Somehow I could not find a solution to this even with the provided documentation. Isn't including fields of type UI within edit and column context unwanted behaviour anyway ? As it says in the docs "It has absolutely no effect on the data of your documents. It is presentational-only." As the value for presentational fields is supposed to be empty anyway it does not make sense to display it or edit it. @violet grove

violet grove
#

I don't think it is unwanted behavior, what if you wanted to render a button that takes you to the page (like you have right there). You just need to render a custom Cell component for your ui field, read about it here: https://payloadcms.com/docs/admin/components#cell-component

Payload CMS

Payload is a headless CMS and application framework built with TypeScript, Node.js, React and MongoDB

last niche
#

Got you. I didn't wanted to have the Cell functionality in the first place but now I can make sense out of it showing the link again. Thanks for you patience!