Document how a config field reads the blueprint's other fields
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 40/100
- Issue-Typ
- Dokumentation
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript
- Bereich
- documentation
Rechercherichtung
Start in the fieldtype documentation page of the statamic/docs repo, where injectPublishContext() is already covered, and look for a place to describe sibling-field access. Read the blueprint builder source for suggestableConditionFieldsProvider and its set-scoped variant, and check how the field-settings component receives suggestableConditionFields. Done means the page either documents a supported way for a config field to read sibling fields, including inside Replicator and Bard sets, or the issue gets a maintainer answer naming the supported API.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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:
inject: {
suggestableConditionFieldsProvider: { default: null },
},
computed: {
siblingFields() {
return this.suggestableConditionFieldsProvider?.suggestableFields?.() ?? [];
},
},
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)readsvm.section.fieldsand throws when called without an argument. A config field has nosectionto pass, so the set's sibling fields have to be found by walking$parentto the field-settings component, which receives them as asuggestableConditionFieldsarray.
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.
- Vorherrschende Sprache
- PHP
- Sterne
- 133
- Forks
- 405
- Ø Merge
- 21 Std. 45 Min.
- Gemergte PRs (30 T.)
- 12
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus statamic/docs
-
Document how conditions treat empty and null valuesEvtl. vergeben @joshdaugherty hat das vor 10 Tagen übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 25/100
Maintainer antworten meist innerhalb von 1 Tag
-
Document the `query_scope` search index optionEvtl. vergeben @joshdaugherty hat das vor 11 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 18/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
Maintainer antworten meist innerhalb von 1 Tag
-
Spaceless tagEvtl. vergeben @marcorieser hat das vor 86 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 15/100
Maintainer antworten meist innerhalb von 1 Tag
-
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
sync-en
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
sync-en
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 4 Tagen
-
Перевод устарел
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
-
bug
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 76/100
m3ue/m3u-editor#1604 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
femiwiki/docker-mediawiki#1497 ·
Maintainer antworten meist innerhalb von 1 Tag