page
The page
object contains following attributes:
Object Fields
Field | Data Type | Description |
---|---|---|
page.url | String | Returns the URL of the page. |
page.identifier | String | Returns an key of the page where the customer in. More identifiers will be added soon. Possible values: home , express_checkout , advanced_page , text_page , cart , checkout , category , product_list , product_detail , sign_in , sign_up , order_confirm , customer/orders , customer/messages , customer/profile and customer/user_credits |
page.is_checkout_page | Boolean | Returns true when shopper is in checkout page.DEPRECATED Use page.identifier instead |
page.query_params | Object | Returns query parameters in key-value pairs hash |
Code Example
{% if page.identifier == 'product_detail' %}
{{ 'product_detail.js' | asset_source }}
{% endif %}
{% if page.url == '/blog/posts' %}
{{ 'posts.js' | asset_source }}
{% endif %}
Updated about 1 year ago