-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes app block validation per: panoply/vscode-liquid#175
CC David
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
App block wrapperAnchor link to section titled **"App block wrapper"**. Merchants can add app blocks to a page in the following ways: | ||
|
||
- As a block within the confines of the section that's rendering the block | ||
- In a similar manner to sections, giving them the full width of the page to render content | ||
|
||
As app blocks aren't sections themselves, Shopify wraps these full-width app blocks in a platform-generated section by default. However, you can override this default section by creating your own section called apps.liquid. | ||
|
||
The `apps.liquid` section schema needs to include a block of type `@app`, as well as a `preset`. If either of these is missing, then an `Apps not supported` or `Apps section is invalid` error is returned in the theme editor and merchants aren't able to use the section. | ||
|
||
> **CAUTION** | ||
> | ||
> The `apps.liquid` section schema can't contain the `templates` schema attribute. This also includes the `templates` attribute within the `enabled_on/disabled_on` schema attributes. It's expected that the `apps.liquid` section is available on all templates. | ||
**Example** | ||
|
||
```liquid | ||
{% for block in section.blocks %} | ||
{% render block %} | ||
{% endfor %} | ||
{% schema %} | ||
{ | ||
"name": "App wrapper", | ||
"settings": [], | ||
"blocks": [ | ||
{ | ||
"type": "@app" | ||
} | ||
], | ||
"presets": [ | ||
{ | ||
"name": "App wrapper" | ||
} | ||
] | ||
} | ||
{% endschema %} | ||
``` | ||
|
||
# | ||
|
||
--- | ||
|
||
[Shopify Documentation](https://shopify.dev/docs/storefronts/themes/architecture/blocks/app-blocks#app-block-wrapper) |