Now that you have the widget on all your pages, you may be wondering how to show it or hide it where you want to.

Understanding Shopify page templates

Template name Used for…
article individual posts in a blog
blog blog page, which lists all articles within a blog
cart the /cart page, which shows a customer’s cart
collection collection pages, which lists all products within a collection
index your home page, at the root URL (/)
page regular shop pages, such as About us and Contact us.
product individual product pages

So what we have done before, is render the bubble in the theme.liquid , using the code on the right.

{% render 'bubble' %}

Untitled

To show the widget on specific pages, we can use conditional filter to either:

  1. Exclude from specific pages (see table above)
  2. Include on specific pages (see table above)

1. Show everywhere except …

For this example, we’ll remove the widget from the cart page, to avoid getting customers distracted. To achieve this, we’ll exclude it with a condition using:

{% if template.name != 'cart' %}
   {% render 'bubble' %}
{% endif %}

Hit “Save”!

Alternatively, you can exclude multiple pages. Let’s say we want to exclude both the cart and regular pages:

{% if template.name != 'cart' and template.name != 'page' %}
   {% render 'bubble' %}
{% endif %}