├── README.textile ├── find-current-handle.liquid ├── find-current-url.liquid └── multilevel-menu.liquid /README.textile: -------------------------------------------------------------------------------- 1 | h1. Shopify Snippets 2 | 3 | h2. Description: 4 | 5 | A collection of useful Liquid snippets to help speed up theme development for Shopify. 6 | 7 | h2. Installation: 8 | 9 | If you are developing locally, simply copy the .liquid files into the snippets directory. 10 | 11 | If you are developing on a live store, go to the template editor screen, and under snippets create a new snippet with the name of the snippet you want to use (without the .liquid extension). Then copy the code into your new snippet. 12 | 13 | h2. Usage: 14 | 15 | @{% include 'snippet-name' %}@ -------------------------------------------------------------------------------- /find-current-handle.liquid: -------------------------------------------------------------------------------- 1 | {% assign current_handle = '' %} 2 | 3 | {% case template %} 4 | {% when 'page' %} 5 | {% assign current_handle = page.handle %} 6 | {% when 'blog' %} 7 | {% assign current_handle = blog.handle %} 8 | {% when 'article' %} 9 | {% assign current_handle = blog.handle %} 10 | {% when 'collection' %} 11 | {% assign current_handle = collection.handle %} 12 | {% when 'product' %} 13 | {% assign current_handle = product.handle %} 14 | {% endcase %} -------------------------------------------------------------------------------- /find-current-url.liquid: -------------------------------------------------------------------------------- 1 | {% assign current_url = '' %} 2 | 3 | {% case template %} 4 | {% when 'page' %} 5 | {% assign current_url = page.url %} 6 | {% when 'blog' %} 7 | {% assign current_url = blog.url %} 8 | {% when 'article' %} 9 | {% assign current_url = blog.url %} 10 | {% when 'collection' %} 11 | {% assign current_url = collection.url %} 12 | {% when 'product' %} 13 | {% assign current_url = product.url %} 14 | {% endcase %} -------------------------------------------------------------------------------- /multilevel-menu.liquid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joshuacc/Shopify-Snippets/d7b3fd3ea4831f16b8db3e59114929b41a437c5a/multilevel-menu.liquid --------------------------------------------------------------------------------