Front Matter Reference
Front matter defines which store resources are available to be rendered within a Stencil template. Front matter is declared at the top of each template and uses YAML syntax. For more information, see Declaring Front Matter Objects.
Supported templates
You can use YAML Front Matter for templates in the templates/pages/
directory. Injecting objects in the front matter of templates/pages/page.html
will make the objects available to custom templates.
You cannot use Front Matter for templates in the following directories:
templates/components/
templates/layout/
templates/pages/custom/
Global attributes
Global attributes are available on all pages.
customer:
returns: true
wishlists:
limit: 10
orders:
limit: 10
recently_viewed_products: true
Property |
Description |
customer |
Customer attributes are always included and are available when an active shopper logs in. |
returns |
Boolean indicating whether to retrieve product return requests for this customer. No filtering available.true: Retrieve requests. null or false: Do not retrieve requests. |
wishlists |
If null , wishlists are displayed. If limit is not specified, it retrieves an unlimited number of wishlists. |
orders |
If null , no orders are displayed. Displays complete and incomplete orders. If limit is not specified, it displays 20 orders. |
recently_viewed_products |
Boolean indicating whether to display recently viewed products. No filtering available. |
limit |
The maximum number of the entity to display. |
products:
featured:
limit: 10
new:
limit: 10
top_sellers:
limit: 10
Property |
Description |
products |
When filtering/limiting, products’ default sorting is by order id, from lowest to highest. |
featured |
null: No featured products displayed. If not set, defaults to 4 products. |
new |
null: No new products displayed. The maximum allowable value is 25. If not defined, defaults to 8 products. |
top_sellers |
null: No top-selling products displayed. If not defined, defaults to all top sellers. |
carousel: true
Property |
Description |
carousel |
Boolean indicating whether to display a carousel on a storefront. No filtering available. |
blog:
recent_posts:
limit: 5
summary: 100
Property |
Description |
blog |
Default sorting is by published_date, from most recent to earliest. This sorting does not work on the blog page. See Blog Attributes. |
recent_posts |
null: No recent blog posts displayed. If not defined, defaults to the maximum of 20 blog posts. |
summary |
Sets the number of characters to display in each blog post summary. If not defined, it displays 100 characters. |
cart: true
Property |
Description |
cart |
Boolean indicating whether to retrieve cart data. false: Do not return cart data. |
categories: true
description: true
Property |
Description |
categories |
Boolean indicating whether to retrieve the category tree during an AJAX request. false: Do not retrieve the category tree. |
description |
Boolean indicating whether to retrieve category descriptions dynamically from the database. Set to true for themes that must display category descriptions when pages render. |
shop_by_brand: true
limit: 10
Property |
Description |
shop_by_brand |
Typically used in a footer or sidebar. null: Do not display this brand list. If not defined, it returns 10 brands, ordered by the number of products per brand. |
Category attributes
Category attributes are available in the context of a category.
category:
shop_by_price: true
products: 10
limit: 10
Property |
Description |
shop_by_price |
Boolean indicating whether to display Shop-by-Price controls. |
products |
Defines the number of products displayed per page for this category. The range of possible values is 1–100 products. |
Blog attributes
Blog attributes are available in the context of a blog.
blog:
posts:
limit: 5
pages: 5
summary: 250
Property |
Description |
posts |
Default sorting is by published_date , from most recent to earliest. |
limit |
null: No blog posts displayed. The maximum is 20 blog posts per page. |
pages |
null: No pagination. If not defined, defaults to five pages. |
summary |
sets the number of characters to display in each blog-post summary. If not defined, it displays 250 characters. |
Product attributes
Product attributes are available in the context of a product.
product:
videos:
limit: 5
images:
limit: 5
reviews: true
limit: 5
related_products:
limit: 10
similar_by_views:
limit:
Property |
Description |
product |
When filtering/limiting, products’ default sorting is by order id, from lowest to highest. |
videos |
If product.videos is not defined, you will not return videos. If you define product.videos , the default behavior is to return all videos. If you define product.videos.limit , this sets the maximum number of videos returned. |
images |
If product.images is not defined, you will not return images. If product.images is defined, you must also define product.images.limit , which throttles the number of images returned. The maximum allowable value for this parameter is five images. |
reviews |
Boolean indicating whether to display product reviews. If product.reviews is present and is not explicitly set to false , reviews will appear. If not defined, defaults to 10 reviews. When filtering/limiting reviews, the default sorting is by review id, from lowest to highest. |
related_products |
Displays products that are related by name. If limit absent or undefined, the default behavior is to display all related products. Inserting limit with no integer will display 0 products. |
similar_by_views |
Displays products similar to those displayed in the current page context. If limit absent or undefined, the default is to display four products. |
Brand attributes
brand:
products:
limit: 50
Property |
Description |
products |
limit defines the number of products displayed per page for this brand. The range of possible values is 1–50 products. |
Brand list attributes
brands:
limit: 50
Property |
Description |
brands |
When retrieving a collection of brands, the default sorting is by brand id, from lowest to highest. limit sets the number of brands displayed in the list. If limit is not defined, returns all brands, up to a maximum of 50. |
Search attributes
search:
product_results:
limit: 16
Property |
Description |
product_results |
limit defines the number of product search results displayed per page. The range of possible values is 1–100 products. |