Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Document how a config field reads the blueprint's other fields

Abierto
#2,003 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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

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) 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.
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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de statamic/docs

Todos los issues de statamic/docs

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.