Skip to Content
CMSStatamicCustom fieldtypes

Custom fieldtypes

Fieldtypes the addon doesn’t know are exported as unknown. Map them in config/headquery.php (field_types), or register a mapper at runtime, for example in a service provider:

use Headquery\Statamic\Schema\FieldMapper; FieldMapper::extend('seo_pro', fn (array $config) => [ 'type' => 'object', 'fields' => [ 'title' => ['type' => 'string'], 'description' => ['type' => 'string'], ], ]);

The returned array is a field definition of the intermediate schema. Available types: string number boolean date enum array object relation asset richtext blocks unknown. The full contract is spec/ir/schema-v1.json.

Last updated on