NouanceLabs / payload-better-fields-plugin

This plugin aims to provide you with very specific and improved fields for the Payload admin panel.
MIT License
124 stars 2 forks source link

Add fields to a block type? #71

Open thijssmudde opened 4 months ago

thijssmudde commented 4 months ago

I have a global which uses a field with type "blocks". Now my question is if it can be made possible that a SlugField can be enabled for a Block in Payload. For example, the following Folder Block should have a slug field.

export const Folder: Block = {
  slug: "folder",
  fields: [
    {
      name: "title",
      label: "Titel",
      type: "text",
      required: true,
    },
    ...SlugField(
      {
        name: "slug",
      },
      {
        useFields: ["title"],
      },
    ),
  ],
};