JSON & Related Fields


Custom Fields offers JSON fields for developers in several places throughout the app.

JSON Field

The JSON Field in the app is simply a place to store and edit raw JSON data. This is most useful in custom code implementations.

The content entry form is simply a text field. There are no configuration options and the template generator just prints the JSON.

Field Collections & Widgets 

Field Collections & Widgets in Custom Fields use JSON fields in the underlying architecture and are much more "user friendly".

Field Collections 
Field Collections are JSON fields that any other field type can be attached to in the interface. For example, a Field Collection for books might contain a Text field for the author and and an Image field for the cover image. All data for the author field and the cover field are stored in one JSON metafield in Shopify. The app can create templates automatically. A Field Collection template will automatically loop over all the fields and print them one after another. This makes an excellent starting point for customizations.

Widgets are identical to Field Collections as far as the underlying architecture since they also use the JSON field type and store all attached field data in one JSON field. Widgets differ from Field Collections in that they start with some preconfigured fields and include javascript and CSS needed to make them work without custom coding. The CSS and Javascript are optional, and not required to use Widgets. Widget templates include all the HTML and Liquid to make the Widget work as expected using the settings applied in the app. They can also be completely customized.