How to add customizable settings for an app embed

Hi everyone,

I have an embedded app block that I would like to have input options for the store owner to set. How would I - for example - add a drop down menu in the area [below extension-test] you see in the attached image?

Some research I’ve done is look at the settings attribute for the schema but this does not seem to have any effect.

{% schema %}
{
  "name": "App Embed",
  "target": "head",
  "enabled_on": {
    "templates": ["product"]
  },
  "javascript": "app.js",
  "settings": [
    {
      "type": "select",
      "id": "my_option",
      "label": "Sample Option",
      "options": [
        {
          "value": 2,
          "label": "2"
        },
        {
          "value": 3,
          "label": "3"
        }
      ]
    }
  ],
  "default": 2
}
{% endschema %}

Thank you!

Hi Didierdonne,

This schema looks to be set up correctly - are other settings not appearing if you test, or just select?

Hi Liam,

This is the only setting I have on the extension. Could there be a caching issue perhaps? The reason why I ask is, the name “Star Rating” isn’t declared anywhere in any of the files. Perhaps I’m missing something that needs to be cleared/refreshed?

Thanks!

It looks to be working now. I re-installed on the dev store. I also noticed the “default” was outside of the settings array and changed all values to strings.

Great to hear it’s working as expected now!