function

Sibling

func Sibling[Value ConditionScalar]( path string, operator ConditionOperator, values ...Value, ) Condition

Build a typed predicate relative to the current object or repeating row.

Source field/options.go:463

@param path
A dot-separated path from the current field's parent object or row. It may descend through non-repeating groups.
@param operator
The typed equals, not-equals, or one-of comparison to perform.
@param values
One comparison value for equals/not-equals, or one or more same-typed values for one-of.
@returns
The declared result.

Attach the returned condition with ShowWhenCondition. Sibling scope starts beside the field being shown, not at the document root, and controls admin presentation only.

Example

go
field.Text(
  "videoURL",
  field.ShowWhenCondition(
    field.Sibling("format", field.ConditionEquals, "video"),
  ),
)

Related types

  • ConditionScalar

    The string, boolean, integer, or floating-point operands accepted by conditions.

  • ConditionOperator

    The finite scalar condition vocabulary.

  • Condition

    An immutable presentation-only logical or scalar condition.

Related guides