method

FieldAuthoringHost.createSchemaPayload

Create a new embedded item's field payload with Go-declared defaults and a fresh identity.

Example

ts
import type { FieldAuthoringHost } from '@riducms/plugin';

function insertCallout(
  authoring: FieldAuthoringHost,
  insert: (fields: Record<string, unknown>) => void
) {
  const fields = authoring.createSchemaPayload?.({
    treeKey: 'blocks',
    caseTag: 'block',
    variantSlug: 'callout'
  });
  if (fields) insert(fields);
}

Arguments

ArgumentTypeDescription
scopeEmbeddedSchemaVariantScopeSelect the declared tree, case tag, and variant to insert.

Returns

New ordinary field data, including a fresh identity and configured defaults. Insert and serialize it through your plugin editor.

Record<string, unknown>

How it works

This method only creates data. It does not insert an outer plugin item, change the parent form, or open an Apply/Cancel draft. Check that the optional method exists before calling it.

Full signature

Related types

Related guides