template
The template
object has a handful of attributes.
template.name
Returns the template's name without the template's custom suffix, if it exists, or the .liquid extension.
<!-- If you're on the product.liquid template -->
{{ template.name }}
product
template.type
Returns the enum value of template's type, e.g. 15
, 1
, 2
, 13
, 5
.
Description | template.type | template.name | URL |
---|---|---|---|
Product detail page | 1 | product | |
Collection page | 2 | collection | |
Custom page | 3 | page | |
Article page | 4 | article | |
Blog page | 5 | blog | |
Search page | 8 | search | /search |
Cart page | 13 | cart | /cart |
Index page | 15 | index | / |
404 page | 16 | 404 | /404 |
Custom page in theme | 41 | theme_page |
<!-- If you're on the product.liquid template -->
{{ template.type }}
1
Updated over 2 years ago