Skip to content

Latest commit

 

History

History
67 lines (57 loc) · 1.24 KB

File metadata and controls

67 lines (57 loc) · 1.24 KB

Category (objects)

Snippet

Multi-select Category, and store Name, ID as object:

{
    "title": "Category (objects)",
    "description": "Multi-select Category, stored as [{ID:string, name:string}...]",
    "type": "array",
    "minItems": 0,
    "maxItems": 10,
    "items": {
        "type": "object",
        "properties": {
            "id": {
                "title": "ID",
                "type": "string"
            },
            "name": {
                "title": "Name",
                "type": "string"
            }
        }
    },
    "propertyOrder": ["id", "name"],
    "ui:extension": {
        "name": "ecomm-toolkit",
        "params": {
            "label": "Category",
            "view": "multi",
            "data": "category",
            "type": "objects"
        }
    }
}

Sample content

{
    "categoryArrayObject": [
        {
            "name": "(shop-all) Shop All",
            "slug": "shop-all",
            "id": "23"
        },
        {
            "name": "(bath) Bath",
            "slug": "bath",
            "id": "18"
        }
    ]
}

Sample UI

Empty field:

Sample UI

Selecting multiple categories:

Sample UI