You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wonder if it's possible to use puck to store a reference of the external source when the external field is used.
Instead of saving the actual text, I want the reference of the entry so I could resolve the text in the correct language.
Puck users are only using english they are meant to focus on the design aspect, we have a contentful space where we keep our text and media assets where copy writers, write in english and sync with Crowdin to get translations from the specialised team.
The translation team publishes the contentful entries in all the remaining language. So It makes sense for the designers to work once and be able to view the text in any language the copy is defined in
The text was updated successfully, but these errors were encountered:
Puck is unopinionated about how you store your data, so you can handle this just like you would with any other React component.
One approach you could take is to create a custom field with an external AutoField inside. That way, before calling the onChange function you receive inside custom fields, you’d filter out the text and only pass the reference to it as the new value.
In your component config’s render function, you’ll then receive just that reference and can use it however you want—whether that’s fetching the actual translation, rendering only the reference, using it for additional logic, or something else entirely.
Puck is unopinionated about how you store your data, so you can handle this just like you would with any other React component.
One approach you could take is to create a custom field with an external AutoField inside. That way, before calling the onChange function you receive inside custom fields, you’d filter out the text and only pass the reference to it as the new value.
In your component config’s render function, you’ll then receive just that reference and can use it however you want—whether that’s fetching the actual translation, rendering only the reference, using it for additional logic, or something else entirely.
Let me know if that helps!
Thank you @FedericoBonel. I will try and share with you the result.
I wonder if it's possible to use puck to store a reference of the external source when the external field is used.
Instead of saving the actual text, I want the reference of the entry so I could resolve the text in the correct language.
Puck users are only using english they are meant to focus on the design aspect, we have a contentful space where we keep our text and media assets where copy writers, write in english and sync with Crowdin to get translations from the specialised team.
The translation team publishes the contentful entries in all the remaining language. So It makes sense for the designers to work once and be able to view the text in any language the copy is defined in
The text was updated successfully, but these errors were encountered: