Shopify / Shopify/liquid

feature request: schema variable support

Open
#1,911 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request
Dominant language
Ruby
Stars
11.9k
Forks
1.5k
Avg merge
17h 55m
Merged PRs (30d)
3

Description

as I'm creating Shopify blocks and there is a limit on the app block size, list settings become very cumbersome due to their size:

    {
      "type": "select",
      "id": "one",
      "label": "One",
      "options": [
        { "value": "a", "label": "A" },
        { "value": "b", "label": "B" },

if I would create 10 drop downs with A-Z selectors, they would almost hit the limit. It would be nice to create something like:

{% schema %}
{%- assign options = [...-%}
...
    {
      "type": "select",
      "id": "one",
      "label": "One",
      "options": options

a scoped variable to the schema or just somehow create:

{% schema %}
{ 
 "variables": { "options": [] }

and reference from inside the schema (probably easier if schema is a json, just search for that value inside the schema under "variables"

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the repository's handling of the {% schema %} block and the variable approaches described in the issue. Done would mean a defined, tested way to reuse option data inside schema JSON without duplicating large lists or exceeding the app block size limit.

Written by the indexing model from the issue text.

Assessment

Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.