page
Lets the merchant select a store page. Returns the page object with its title, handle, and content.
Properties
| Property | Type | Required | Description |
|---|---|---|---|
type | "page" | Yes | Field type identifier |
label | string | Yes | Label shown in the builder |
default | string | No | Default value (empty string if omitted) |
Usage
- schema.json
- Template
- Output
{
"selectedPage": {
"type": "page",
"label": "Page",
"default": ""
}
}
{% if widget.settings.selectedPage %}
<h2>{{ widget.settings.selectedPage.title }}</h2>
<div class="page-content">
{{ widget.settings.selectedPage.content | safe }}
</div>
{% endif %}
{
"selectedPage": {
"_id": "691f38a8a60232b8a1049823",
"title": "About Us",
"handle": "about-us",
"content": "<p>Welcome to our store...</p>"
}
}
Page object
The returned page object includes title, handle, and content. Access fields like page.title or render HTML content with page.content | safe.
Interactive Preview
Interactive Preview
About Us
handle: about-us
Live Output
{
"selectedPage": {
"_id": "691f38a8a60232b8a1049823",
"title": "About Us",
"handle": "about-us",
"content": "<p>Welcome to our store...</p>"
}
}