How to create a dynamic link with variables in Shopify block schema?

I’m trying to create a link to the app settings within a Shopify block using schema in Liquid. I want to include dynamic variables like shop.domain and block.id in the URL.

Here’s my code:

{% schema %}
{
    "name": "block",
    "target": "body",
    "settings": [
        {
          "type": "header",
          "content": "Customize [App Configuration Page](https://admin.shopify.com/store/{{ shop.domain }}/apps/myapp/{{ block.id }})"
        }
    ]
}
{% endschema %}

However, the variables {{ shop.domain }} and {{ block.id }} are not being parsed within the schema. The link displays as plain text rather than dynamically replacing these variables.

Is there a way to include dynamic variables in the link within the Shopify block schema? If not, are there any recommended workarounds for creating dynamic links in Shopify blocks?

Hey @greg11223

Shopify’s schema JSON section doesn’t support Liquid templating directly, which is why your variables like {{ shop.domain }} and {{ block.id }} aren’t being parsed. Liquid variables can only be used in the main Liquid template outside the JSON schema.

Here’s how you can structure it:

{% assign app_link = "https://admin.shopify.com/store/" | append: shop.domain | append: "/apps/myapp/" | append: block.id %}

  ## Customize App Configuration
  

Go to App Configuration Page

{% schema %}
{
    "name": "block",
    "target": "body",
    "settings": [
        {
          "type": "header",
          "content": "Customize the App Configuration from your Shopify Admin."
        }
    ]
}
{% endschema %}

This approach will create a clickable, dynamic link that takes users to the app configuration page while displaying the section header within the schema.

Best Regards,

Moeed