Managing bundle fields with the Field API

slaweally 10.09.2026 10:30 0 yanıt 31 görüntülenme

Short flow: /aacp/fieldspost bundle → add field. Set subtitle to type text and authors to entity_reference (target: user, cardinality -1).

Edit the post in Studio and the new widgets appear; values go into Node::data, no extra column. To display:

{{ cp_field(node, 'subtitle') }} {{ cp_fields(node) }}

Reference fields resolve in a single query per target type via ReferenceBatchLoader, so there is no N+1 on the list page. Flag the field queryable and it is written to node_field_index and filtered independently of the DB engine.

Note: name is immutable after creation; changing type is blocked while the bundle holds data.

Forever CPalius **