What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Custom editor for JSON metafield

Custom editor for JSON metafield

HonzaPobořil
Visitor
2 0 1

I would like to use json metafield to store some complex structures with product metadata, so I can load them by Storefront API and render them in a custom frontend.

 

But how to simplify data admin for store admin users?

 

I can not expect them to learn to "code" JSON, do not break its schema and know how keys should be named etc. They need some UI to manage that structure.

 

How can I embed my UI into product manage page, without creating Shopify App? I could imagine to create bookmarklet admin need to start on Shopify Admin what will load my custom editor, but is there better way?

Replies 2 (2)

PaulNewton
Shopify Partner
7450 657 1565

Apps do not embed into the shopify admin like this.


If you need a schema editor it will either need to be external, an app, or as you imagine a bookmarklet or even a browser extension.

There's also the edge case of using the theme system to have an an internal editor only useable by staff in the visual theme editor but that does not resolve the issue of connecting to the admin-api to update those metafields.

 

More likely the simplest approach can be just setting up something like a googlespreadsheet and using googlescripts or a service like zapier to push the final json.

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


KuznetsEnvy
Shopify Partner
38 0 12

I second on that. Let me know how you resolved the issue for your use case.

It's a shame JSON metafields don't allow to set schema structure and don't have a visual editor. 
In a sense, theme customizer is exactly that: a visual editor for JSON templates.
Implementing something like this for metafields seems to be a logical step forward on Shopify's behalf.