You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document how a config field reads the blueprint's other fields #2003
The fieldtype docs cover how a fieldtype's own component reads other values in the form (injectPublishContext()), but not how a config field reads the other fields of the blueprint being edited. A config field is a component rendered inside the field-settings panel of the blueprint builder.
Use case
A custom date fieldtype offers "earliest date" and "latest date" config options. Each should be a select that lists the blueprint's other date fields, so a boundary can reference a sibling field by handle. To populate that select, the config field's Vue component needs the list of fields in the blueprint.
What works today (v6.26.0)
The only mechanism found is the blueprint builder's provided suggestableConditionFieldsProvider, the same provider the field-conditions builder uses:
suggestableFields() returns the flat field list ({ handle, type, config: { display, ... } }).
Two things make it hard to rely on:
It isn't documented, so it's unclear whether it's meant for addons or may change between releases.
It behaves differently inside a Replicator or Bard set. There, the nearest provider is the set-scoped variant, whose suggestableFields(vm) reads vm.section.fields and throws when called without an argument. A config field has no section to pass, so the set's sibling fields have to be found by walking $parent to the field-settings component, which receives them as a suggestableConditionFields array.
injectPublishContext() doesn't cover this: inside the field-settings panel it resolves to the field's own config values, not the parent blueprint's fields.
Request
Either:
document suggestableConditionFieldsProvider (or whatever is intended for this) on the fieldtype page, including how it behaves inside sets; or
say which supported API a config field should use to read sibling fields, if the provider is internal.
Activity