Hi all 👋
I'm having trouble hiding the id of a collection. I assumed I could do it like this, but I get caught in a loop where it can't log me in properly.
{
name: 'id',
type: 'text',
hidden: true,
},
I can identify at least two potential issues... the
type
is not correct, and/or
hidden
isn't doing what I think it is.
The
hidden
config is defined as
Restrict this field's visibility from all APIs entirely. Will still be saved to the database, but will not appear in any API or the Admin panel.
does
hidden: true
mean that the id is not included in the user object when it is fetched from the database? If this is the case, how do I include the id in the document but hide it from the toggle columns options? (pictured)
Any guidance is appreciated. Thank you
hey @browniedev — well, the
id
will
be included when fetched from the database—using
hidden: true
will simply hide it from being returned from any of Payload's APIs
we should be able to build in controls to "deactivate" fields from being used as columns, I'd say that is the right way to go here
because hiding an
id
will have unknown side-effects in the admin UI, etc
we would happily accept a PR for this as well btw
maybe a new property on a field config like
admin.disableColumn
or similar
and then simply check for that property when we expose what columns are available to use in the List view
could be a good first contribution if you're up for it 😈
Yes!! When I get home today, I'll follow up on this 💯
this might be helpful if you end up deciding to PR
I'm open to the idea of making a contribution, do you have any documentation on the process of contributing?
this plus the Discussion above should be helpful
@browniedev have you tried to implement this? Would be nice to have!
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.