@@ -11,6 +11,8 @@ types. Each field type (input, date, relation, etc.) has an adapter that control
1111- ** Saved** — transforming incoming API request data into the format the field definition
1212 expects before it is stored.
1313- ** Read** — normalizing stored data into an API-friendly response format.
14+ - ** Detail page** — providing a detail-page-specific representation that may differ from the
15+ normalized value (falls back to normalization when not implemented).
1416- ** Exported** — converting stored data into a string for grid/CSV export.
1517- ** Inherited** — resolving inherited values in the data object hierarchy.
1618- ** Previewed** — providing preview data for search results.
@@ -43,6 +45,7 @@ and can be added when your field type needs the corresponding capability.
4345| ---| ---| ---|
4446| ` SetterDataInterface ` | ** Yes** | Transform API request data for saving |
4547| ` DataNormalizerInterface ` | No | Customize the API response format |
48+ | ` DetailDataInterface ` | No | Provide a detail-page-specific value (falls back to ` DataNormalizerInterface ` ) |
4649| ` DataExportInterface ` | No | Provide a string representation for grid/CSV export |
4750| ` DataInheritanceInterface ` | No | Resolve inherited values in the object hierarchy |
4851| ` SearchPreviewDataInterface ` | No | Contribute preview data to search results |
@@ -128,6 +131,47 @@ Return the API-friendly representation of the value.
128131
129132---
130133
134+ ### DetailDataInterface
135+
136+ Implement this interface when the detail page of a data object should display a different
137+ representation than the normalized value. When this interface
138+ is ** not** implemented, the system automatically falls back to
139+ ` DataNormalizerInterface::normalize() ` .
140+
141+ ** When to use:**
142+
143+ - The detail page requires a richer or more descriptive value than from ` normalize() ` .
144+
145+
146+ ``` php
147+ namespace Pimcore\Bundle\StudioBackendBundle\DataObject\Data;
148+
149+ use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\Model\FieldContextData;
150+ use Pimcore\Model\DataObject\ClassDefinition\Data;
151+ use Pimcore\Model\DataObject\Concrete;
152+
153+ interface DetailDataInterface
154+ {
155+ public function getDetailData(
156+ Concrete $object,
157+ mixed $value,
158+ Data $fieldDefinition,
159+ ?FieldContextData $contextData = null,
160+ ): mixed;
161+ }
162+ ```
163+
164+ | Parameter | Description |
165+ | ---| ---|
166+ | ` $object ` | The data object being loaded for the detail page. |
167+ | ` $value ` | The raw stored value from the data object getter. |
168+ | ` $fieldDefinition ` | The Pimcore field definition for this field. |
169+ | ` $contextData ` | Container context (object brick, localized field, etc.), or ` null ` for top-level fields. |
170+
171+ Return the detail-page-specific representation of the value.
172+
173+ ---
174+
131175### DataExportInterface
132176
133177Implement this interface when the field type needs custom handling for grid column display
@@ -314,6 +358,7 @@ namespace App\DataObject\Data\Adapter;
314358use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\DataExportInterface;
315359use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\DataInheritanceInterface;
316360use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\DataNormalizerInterface;
361+ use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\DetailDataInterface;
317362use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\Model\FieldContextData;
318363use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\SearchPreviewDataInterface;
319364use Pimcore\Bundle\StudioBackendBundle\DataObject\Data\SetterDataInterface;
@@ -326,6 +371,7 @@ use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
326371final readonly class CustomFieldAdapter implements
327372 SetterDataInterface,
328373 DataNormalizerInterface,
374+ DetailDataInterface,
329375 DataExportInterface,
330376 DataInheritanceInterface,
331377 SearchPreviewDataInterface
@@ -374,6 +420,19 @@ final readonly class CustomFieldAdapter implements
374420 return $value;
375421 }
376422
423+ // --- DetailDataInterface (optional) ---
424+
425+ public function getDetailData(
426+ Concrete $object,
427+ mixed $value,
428+ Data $fieldDefinition,
429+ ?FieldContextData $contextData = null,
430+ ): mixed {
431+ // Return a detail-page-specific representation of the value.
432+ // When this interface is not implemented, normalize() is called instead.
433+ return $value;
434+ }
435+
377436 // --- DataExportInterface (optional) ---
378437
379438 public function getExportData(
@@ -466,19 +525,19 @@ class required.
466525| ` InputQuantityValueAdapter ` | ` inputQuantityValue ` | Setter |
467526| ` QuantityValueRangeAdapter ` | ` quantityValueRange ` | Setter |
468527| ` UrlSlugAdapter ` | ` urlSlug ` | Setter |
469- | ` CalculatedValueAdapter ` | ` calculatedValue ` | Setter |
528+ | ` CalculatedValueAdapter ` | ` calculatedValue ` | Setter, Detail |
470529| ` EncryptedFieldAdapter ` | ` encryptedField ` | Setter, Normalizer, Export |
471530| ` TableAdapter ` | ` table ` | Setter, SearchPreview |
472531| ` StructuredTableAdapter ` | ` structuredTable ` | Setter, Normalizer, SearchPreview |
473532| ` BlockAdapter ` | ` block ` | Setter, Normalizer, SearchPreview |
474533| ` FieldCollectionsAdapter ` | ` fieldcollections ` | Setter, Normalizer, SearchPreview |
475- | ` ObjectBricksAdapter ` | ` objectbricks ` | Setter, Normalizer, Inheritance, SearchPreview |
476- | ` LocalizedFieldsAdapter ` | ` localizedfields ` | Setter, Normalizer, Inheritance, SearchPreview |
477- | ` ClassificationStoreAdapter ` | ` classificationstore ` | Setter, Normalizer, Inheritance, SearchPreview |
534+ | ` ObjectBricksAdapter ` | ` objectbricks ` | Setter, Normalizer, Detail, Inheritance, SearchPreview |
535+ | ` LocalizedFieldsAdapter ` | ` localizedfields ` | Setter, Normalizer, Detail, Inheritance, SearchPreview |
536+ | ` ClassificationStoreAdapter ` | ` classificationstore ` | Setter, Normalizer, Detail, Inheritance, SearchPreview |
478537
479538** Legend:** Setter = ` SetterDataInterface ` , Normalizer = ` DataNormalizerInterface ` ,
480- Export = ` DataExportInterface ` , Inheritance = ` DataInheritanceInterface ` ,
481- SearchPreview = ` SearchPreviewDataInterface `
539+ Detail = ` DetailDataInterface ` , Export = ` DataExportInterface ` ,
540+ Inheritance = ` DataInheritanceInterface ` , SearchPreview = ` SearchPreviewDataInterface `
482541
483542::: info
484543
0 commit comments