Skip to content

Instantly share code, notes, and snippets.

@tinotriste
Last active December 15, 2015 21:49
Show Gist options
  • Save tinotriste/5328118 to your computer and use it in GitHub Desktop.
Save tinotriste/5328118 to your computer and use it in GitHub Desktop.
Shopify: Find current handle
{% assign current_handle = '' %}
{% case template %}
{% when 'page' %}
{% assign current_handle = page.handle %}
{% when 'blog' %}
{% assign current_handle = blog.handle %}
{% when 'article' %}
{% assign current_handle = blog.handle %}
{% when 'collection' %}
{% assign current_handle = collection.handle %}
{% when 'product' %}
{% assign current_handle = product.handle %}
{% endcase %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment