A Payload site, ready to clone

Placeholder: layered waves in teal

A project’s own settings, and its footer gets them

Why

A derived project wanted its partners’ logos in the footer. With no place for them in Settings, they were constants in the footer’s code, and changing a logo meant a deploy. extendCollection covered collections only.

Fields on a settings page

A project plugin now adds fields to any page under Settings with extendGlobal: General, Brand, Appearance, SEO and sharing, Social profiles, Analytics, Feeds or Site texts. They go at the end of the page, or of its first tab. Logos belong in Brand. A name the page already uses, or one Payload reserves, stops the app and pnpm check:project, naming both owners; so does a page that isn’t one of these.

A settings page of its own

For data that fits none of them, settingsGlobal adds a page to the Settings group, such as Settings → Partners, with the same access as the others: site managers and admins change it, editors only read it, publishers don’t see it. Its name must be given in every admin language. A slug already taken stops the app, naming both.

Where they arrive

The project’s footer and header receive settings, keyed by the page’s slug: the fields it added (settings['settings-brand'].acmePartnerLogos) and its own pages whole, in the page’s language, with images ready to render. Saving any of them refreshes the cached pages at once. Both need the project’s own migration. Nothing changes in this demo, which uses neither: the README’s “Extending template-site’s globals and settings” and “Site shell” explain them.

In a project plugin
extendGlobal('settings-brand', {
  fields: [{ name: 'acmePartnerLogos', type: 'array',
    fields: [{ name: 'logo', type: 'upload', relationTo: 'media' }] }],
})