Hello!
Our app has an app theme extension which has a few options for stylings and customizations. Because our app started with ScriptTag and Asset API, all these settings were created as part of the app settings. We want to now migrate these settings into the app theme extension settings schema. But we’ve hit two limitations, mainly that settings key in the schema doesnt support app metafields and also font picker doesnt work for example.
- Settings Schema - App metafields in settings
App metafields in settings Is there any workaround for this? Thinking maybe I can build an API to crawl the store and sync settings from theme settings to my app metafields, but this seems like an overkill and super fragile solution.
- Font Picker setting
Below is a sample code from my extension block:
{% schema %}
{
"name": "Shop The Look",
"templates": ["product", "cart"],
"stylesheet": "bundle.css",
"javascript": "bundle.js",
"target": "section",
"settings":[
{
"type":"header",
"content":"Heading"
},
{
"type":"font_picker",
"id":"heading_font",
"label":"Font",
"default":"helvetica_n4"
}
]
}
{% endschema %}
{%- style -%}
.shopthelook-section-v2 .heading {
font-family: {{ block.settings.heading_font.family }};
}
{%- endstyle -%}
I picked a new font family in theme editor and I see in DevTools inspector that it matches, but the font never gets applied (rendered font isn’t the font I picked.) My understanding is that Shopify handles font loading in this case, but could this be only for theme blocks and not app theme blocks?
I tried loading the font myself by getting its url from the font object above and adding it + adding @font-face and this also didn’t work (I can see theme loaded in network tab though.) Even for safe web fonts like “Arial” for example. Am I doing something wrong or is this expected behaviour?
It would be great if I can put all of my settings inside theme editor as that’s native behaviour and I don’t have to build and maintain my own editor.
Thanks!