type

Block

Block is one discriminated layout allowed by a blocks field.

Properties

PropertyTypeDescription
TypeNamestringTypeName optionally names a reusable generated type family; it never changes the stored slug.
SlugstringSlug is the stable discriminator stored with block values.
LabelsBlockLabelsLabels overrides the singular and plural names shown to authors.
FieldsFieldsFields defines the values stored by this block type.
AdminBlockAdminAdmin configures this block type in the framework admin.

Full signature

type Block struct { // TypeName optionally names a reusable generated type family; it never changes the stored slug. TypeName string // Slug is the stable discriminator stored with block values. Slug string // Labels overrides the singular and plural names shown to authors. Labels BlockLabels // Fields defines the values stored by this block type. Fields Fields // Admin configures this block type in the framework admin. Admin BlockAdmin }

Source field/field.go:77

Methods

  • Block.Snapshot()

    Snapshot returns a detached block, copying child fields and label translations. Executable callbacks retain their original behavior.

Related guides