This is a similar issue to
https://discord.com/channels/967097582721572934/1082661558250905703, that was fixed, but with an extra layer of also being inside of a tab.
Let me know if this
shouldbe possible and I'm just doing it wrong. Otherwise, I can open an issue.
In this example,
textand
linkaren't recognized as a
defaultColumnoption.
import { CollectionConfig } from 'payload'
export const Buttons: CollectionConfig = {
slug: 'buttons',
admin: {
defaultColumns: ['text', 'link', 'updatedAt'],
},
fields: [
{
type: 'tabs',
tabs: [
{
name: 'content',
label: 'Content',
fields: [
{
type: 'row',
fields: [
{
name: 'text',
label: 'Text',
type: 'text',
required: true,
},
{
name: 'mobileText',
label: 'Mobile text',
type: 'text',
},
],
},
{
name: 'link',
label: 'Link',
type: 'text',
},
{
name: 'file',
type: 'upload',
relationTo: 'media',
},
],
},
],
},
],
}
export default ButtonsI think this is happening because your interpretation of what the tabs field is doing is slightly wrong here. You have a
namedtab, which would make your link appear as
content.linkinstead of
just
linkwhich is why you're running into issues. If you don't want your tabs to have an impact on your data model, then you can remove the
namefrom the tab and just leave it with a
labelThank you
@654031862146007055! That fixed my problem, as well as my interpretation.
It's my pleasure!
Star
Discord
online
Get dedicated engineering support directly from the Payload team.