Payload Adsign Plugin

In Frontend Notice Field

Tell editors that a part of the website is hardcoded in the frontend

A UI field that shows a notice banner in the admin panel, telling editors that this part of the website is hardcoded in the frontend and must be changed by a developer. It stores no data.

The default text is translated to English, Norwegian, Swedish and Danish.

Notice banner saying this part is hardcoded in the website

Usage

collections/Pages/index.ts
import { inFrontendNoticeField } from '@adsign/payload-adsign-plugin';

export const Pages: CollectionConfig = {
  fields: [
    {
      type: 'tabs',
      tabs: [
        {
          name: 'heroSection',
          label: 'Hero',
          fields: [inFrontendNoticeField({ name: 'heroNotice' })],
        },
      ],
    },
  ],
};

Options

OptionTypeDefaultDescription
namestring-Field name. Must be unique within the same fields array
messagestring | Record<string, string>-Overrides the default text. Use an object keyed by language to translate it
adminUIField['admin']-Payload admin options, e.g. condition, position or width

Examples

With a custom message:

inFrontendNoticeField({
  name: 'menuNotice',
  message: 'The menu is managed by a developer.',
})

With a translated custom message:

inFrontendNoticeField({
  name: 'menuNotice',
  message: {
    en: 'The menu is managed by a developer.',
    nb: 'Menyen styres av en utvikler.',
  },
})

On this page