Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ai/claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,7 @@ iterate over an array that has more than 50 items. The following arrays can be p

- [`all_products`](https://shopify.dev/docs/api/liquid/objects/all_products)
- [`article.comments`](https://shopify.dev/docs/api/liquid/objects/article#article-comments)
- [`article_list` settings](/themes/architecture/settings/input-settings#article_list)
- [`blog.articles`](https://shopify.dev/docs/api/liquid/objects/blog#blog-articles)
- [`collections`](https://shopify.dev/docs/api/liquid/objects/collections)
- [`collection.products`](https://shopify.dev/docs/api/liquid/objects/collection#collection-products)
Expand Down
1 change: 1 addition & 0 deletions ai/github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,7 @@ iterate over an array that has more than 50 items. The following arrays can be p

- [`all_products`](https://shopify.dev/docs/api/liquid/objects/all_products)
- [`article.comments`](https://shopify.dev/docs/api/liquid/objects/article#article-comments)
- [`article_list` settings](/themes/architecture/settings/input-settings#article_list)
- [`blog.articles`](https://shopify.dev/docs/api/liquid/objects/blog#blog-articles)
- [`collections`](https://shopify.dev/docs/api/liquid/objects/collections)
- [`collection.products`](https://shopify.dev/docs/api/liquid/objects/collection#collection-products)
Expand Down
2 changes: 1 addition & 1 deletion data/tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@
},
{
"name": "Paginating setting arrays",
"description": "To allow the pagination of `product_list` and `collection_list` settings to operate independently from other paginated lists on a page, these lists use a pagination query parameter with a unique key. The key is automatically assigned by the `paginate` tag, and you don't need to reference the key in your code. However, you can access the key using [`paginate.page_param`](/docs/api/liquid/objects/paginate#paginate-page_param).\n\n> Tip:\n> To paginate two arrays independently without refreshing the entire page, you can use the [Section Rendering API](/docs/api/ajax/section-rendering).\n",
"description": "To allow the pagination of `product_list`, `article_list` and `collection_list` settings to operate independently from other paginated lists on a page, these lists use a pagination query parameter with a unique key. The key is automatically assigned by the `paginate` tag, and you don't need to reference the key in your code. However, you can access the key using [`paginate.page_param`](/docs/api/liquid/objects/paginate#paginate-page_param).\n\n> Tip:\n> To paginate two arrays independently without refreshing the entire page, you can use the [Section Rendering API](/docs/api/ajax/section-rendering).\n",
"syntax": "",
"path": "/",
"raw_liquid": "",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"prettier": "^2.8.8",
"vitest": "^0.32.2",
"vscode-json-languageservice": "^5.3.10"
}
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
25 changes: 25 additions & 0 deletions schemas/theme/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"markdownDescription": "The type of the input or sidebar setting. This value determines the type of field that gets rendered into the editor.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/settings)",
"enum": [
"article",
"article_list",
"blog",
"checkbox",
"collection",
Expand Down Expand Up @@ -57,6 +58,10 @@
"if": { "required": ["type"], "properties": { "type": { "const": "article" } } },
"then": { "$ref": "#/definitions/article" }
},
{
"if": { "required": ["type"], "properties": { "type": { "const": "article_list" } } },
"then": { "$ref": "#/definitions/article_list" }
},
{
"if": { "required": ["type"], "properties": { "type": { "const": "blog" } } },
"then": { "$ref": "#/definitions/blog" }
Expand Down Expand Up @@ -196,6 +201,26 @@
"additionalProperties": false
},

"article_list": {
"allOf": [{ "$ref": "#/definitions/inputSettingsStandardAttributes" }],
"properties": {
"type": {
"const": "article_list",
"description": "A setting of type article_list outputs an article picker field that's automatically populated with the available articles for the store. You can use these fields to capture multiple articles, such as a group of articles to feature on the homepage.",
"markdownDescription": "A setting of type `article_list` outputs an article picker field that's automatically populated with the available products for the store. You can use these fields to capture multiple articles, such as a group of articles to feature on the homepage.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/settings/input-settings#article_list)"
},
"limit": {
"type": "integer",
"description": "The maximum number that the merchant can select. The default limit, and the maximum limit you can set, is 50."
},
"default": true,
"label": true,
"info": true,
"id": true
},
"additionalProperties": false
},

"blog": {
"allOf": [{ "$ref": "#/definitions/inputSettingsStandardAttributes" }],
"properties": {
Expand Down
6 changes: 6 additions & 0 deletions tests/fixtures/theme-settings-all-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@
"info": "This is an article",
"label": "the article's label"
},
{
"type": "article_list",
"id": "article_list",
"label": "Articles",
"limit": 12
},
{
"type": "blog",
"id": "my-blog",
Expand Down
2 changes: 1 addition & 1 deletion tests/section.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('JSON Schema validation of Liquid theme section schema tags', () => {
expect(diagnostics).toStrictEqual([
{
code: 1,
message: expect.stringContaining('Value is not accepted. Valid values: "article", "blog"'),
message: expect.stringContaining('Value is not accepted. Valid values: "article", "article_list", "blog"'),
severity: 1,
range: expect.objectContaining({
start: expect.objectContaining({
Expand Down
4 changes: 3 additions & 1 deletion tests/test-constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export const SETTINGS_TYPES_NOT_SUPPORTING_VISIBLE_IF = [
'article',
'article_list',
'blog',
'collection',
'collection_list',
Expand All @@ -14,6 +15,7 @@ export const SETTINGS_TYPES_NOT_SUPPORTING_VISIBLE_IF = [

export const INPUT_SETTING_TYPES = [
'article',
'article_list',
'blog',
'checkbox',
'collection_list',
Expand Down Expand Up @@ -48,4 +50,4 @@ export const INPUT_SETTING_TYPES = [

export const SIDEBAR_SETTING_TYPES = ['header', 'paragraph'];

export const RESOURCE_LIST_SETTING_TYPES = ['product_list', 'collection_list', 'metaobject_list'];
export const RESOURCE_LIST_SETTING_TYPES = ['product_list', 'collection_list', 'metaobject_list', 'article_list'];
2 changes: 1 addition & 1 deletion tests/theme-settings/general.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('Module: theme settings validation (config/settings_schema.json)', () =
{
code: 1,
message: expect.stringContaining(
'Value is not accepted. Valid values: "article", "blog"',
'Value is not accepted. Valid values: "article", "article_list", "blog"',
),
severity: 1,
range: expect.objectContaining({
Expand Down