Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to customize document preparation via the API #127

Open
mxmzb opened this issue Dec 14, 2020 · 1 comment
Open

Allow users to customize document preparation via the API #127

mxmzb opened this issue Dec 14, 2020 · 1 comment
Labels
enhancement New feature or request scope:sync-utils
Milestone

Comments

@mxmzb
Copy link

mxmzb commented Dec 14, 2020

I am looking at https://www.sanity.io/docs/localization and thinking, that it would be nice to restructure the shopifyProduct schema (e.g. instead of transferring the shopify title into shopifyProduct.title transfer it into shopifyProduct.title.en), or rename it (e.g. instead of transferring the shopify title into shopifyProduct.title transfer it into shopifyProduct.shopifyTitle) so you can have a clean localized title attribute.

PS.: Thanks for building this toolset!

@good-idea
Copy link
Owner

Hiya, thanks for taking a look and for opening the issue!

This is a good idea -- I've renamed the issue. I'll add something like a transformDocument option to the API that allows users to customize how the document is prepared before being patched. This probably won't make it into 1.0, though.

So for now, an alternative option would be:

  • Setting the title field to hidden
  • Add your own customTitle field with localization
  • Override the preview prop for the document type to get the title from customTitle instead of the original field.
  • But, you'll still have the issue of the english title not being automatically populated. To fix this, you could set up a document action that populates the field based on title if it is empty.

@good-idea good-idea changed the title Allow renaming/restructuring shopify data on sync Allow users to customize document preparation via the API Dec 16, 2020
@good-idea good-idea added enhancement New feature or request scope:sync-utils labels Dec 16, 2020
@good-idea good-idea added this to the 1.1 milestone Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request scope:sync-utils
Projects
None yet
Development

No branches or pull requests

2 participants