Hello all, I'm trying to set up a link field in the admin UI. I used the example from the payload website which provides a dropdown which populates with pages/posts from a few collections.
I have a few pages that I am setting up as globals, and I am looking for a way to include these in the select dropdown. Does anyone have a suggestion?
Here is the relevant field entry:
{
name: 'reference',
label: 'Document to link to',
type: 'relationship',
relationTo: ['pages', 'posts', 'case-studies'],
required: true,
maxDepth: 1,
admin: {
condition: (_, siblingData) => siblingData?.type === 'reference',
},
},
I have tried adding the global slug in the array, but that does not work.
There’s no way to get them to show up in those select inputs. Curious types of content you are creating as globals? I would likely recommend against that for other reasons
Ok thank you for the info Jarrod. I had planned to create my Home page and a few other pages which use a different template as globals. Maybe I will reorganize those pages into regular Collections.
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.