Workaround for personalizing a Storyblok block that uses reference fields?
Our testimonial block pulls quotes via a reference field, and reference fields are not supported by the Croct integration, so the field does not appear in the mapping. Before asking I tried:
- Mapping the parent block anyway, hoping the resolved reference would come through. It does not, the field is simply not offered.
- Wrapping the reference in a nested block. Same limitation applies.
- Duplicating the testimonial content inline per variant, which works but means editors maintain quotes in two places.
Has anyone found a cleaner way to restructure this
2 answers
The limitation is on the field type, not the block, so the usual approach is to restructure so the part that varies uses supported field types. Rich text, table, and reference fields are the unsupported trio; plain text, textarea, numbers, assets and so on all map fine.
For a testimonial block specifically, one option is to stop personalizing the quote content itself and instead personalize a plain text field that selects which testimonial to show (a key or slug your frontend resolves). The reference data stays canonical in one place, and only the selector varies per audience. Unmapped fields keep serving the regular Storyblok content, so the rest of the block is untouched.
Posting what we ended up shipping in case it helps someone. We went with a variation of paulo.m's idea:
- Kept the testimonial documents exactly as they are, referenced as before.
- Added a plain text field testimonialKey to the block and mapped only that field through the Croct field.
- The frontend resolves the key against the already-fetched references, with the original reference as fallback when the key is empty or unknown.
Editors maintain quotes in one place, the experiment layer only decides which key each audience gets, and if Croct returns nothing the default reference renders as before. Two days in production, no issues so far.
Nice, the fallback-on-unknown-key detail is a good touch. Stealing this for our logo wall block.