Document how a config field reads the blueprint's other fields
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 40/100
- Tipo de issue
- Documentación
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
- Área
- documentation
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- PHP
- Estrellas
- 133
- Forks
- 405
- Merge medio
- 21 h 45 min
- PR fusionados (30 d)
- 12
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de statamic/docs
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Chunked UploadsAbierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Installation / Deployment Guides
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Document how conditions treat empty and null valuesPosiblemente ocupada @joshdaugherty la tomó hace 11 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
Document the `query_scope` search index optionPosiblemente ocupada @joshdaugherty la tomó hace 12 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 18/100
Los mantenedores suelen responder en 1 día
Todos los issues de statamic/docs
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 2 días
-
backend bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
smarty-php/smarty#1215 ·