This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Liquid for Mephisto Cheatsheet | |
Compiled by Lee Leonard | |
Version 0.2 - 31 Jan 2007 (liquid 1.5.0; Mephisto 0.7.3) | |
This is a second draft -- corrections and suggestions are even more | |
encouraged. Send them to <l...@tempestprod.com>. | |
Basic Syntax | |
{{ (variable | string) ['|' filter1 ['|' filter2...]] }} | |
{% controltag %} [..] {% endcontroltag %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub, sup { | |
/* Specified in % so that the sup/sup is the | |
right size relative to the surrounding text */ | |
font-size: 75%; | |
/* Zero out the line-height so that it doesn't | |
interfere with the positioning that follows */ | |
line-height: 0; | |
/* Where the magic happens: makes all browsers position |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Change window.location.hash without scrolling the page, even in IE | |
// by renaming the element's id temporarily | |
function changeHashWithoutScrolling(hash) { | |
const id = hash.replace(/^.*#/, '') | |
const elem = document.getElementById(id) | |
elem.id = `${id}-tmp` | |
window.location.hash = hash | |
elem.id = id | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Solution brought to you by Caroline Schnapp --> | |
<!-- See this: http://wiki.shopify.com/Related_Products --> | |
{% assign image_size = 'compact' %} | |
{% assign heading = 'Other fine products' %} | |
{% if product.tags.size > 0 %} | |
<h3>{{ heading }}</h3> | |
<ul class="related-products"></ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// (c) Copyright 2016 Caroline Schnapp. All Rights Reserved. Contact: mllegeorgesand@gmail.com | |
// See https://docs.shopify.com/themes/customization/navigation/link-product-options-in-menus | |
var Shopify = Shopify || {}; | |
Shopify.optionsMap = {}; | |
Shopify.updateOptionsInSelector = function(selectorIndex) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<body> | |
<header role="banner"> | |
<a href="/" rel="home">My company</a> | |
<nav role="navigation"> | |
<a href="/about">About</a> | |
<a href="/contact">Contact</a> | |
</nav> | |
</header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% paginate collection.products by 20 %} | |
<!-- the top of your collections.liquid --> | |
<!-- START PRODUCTS --> | |
{% for product in collection.products %} | |
<!-- START PRODUCT {{ forloop.index | plus:paginate.current_offset }} --> | |
<div class="product" id="product-{{ forloop.index | plus:paginate.current_offset }}"> | |
{% include 'product' with product %} | |
</div> | |
<!-- END PRODUCT {{ forloop.index | plus:paginate.current_offset }} --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %}Get page handle{% endcomment %} | |
{% assign listname = page.handle %} | |
{% capture listname %}{{ page.title | handle }}{% endcapture %} | |
{% for link in linklists[listname].links %} | |
{% if link.object.products.first.id %} {% comment %}Make sure it's not empty{% endcomment %} | |
<a href="{{ link.url }}" title="{{ link.title }}"> | |
{{ link.object.products.first.featured_image | product_img_url: 'medium' | img_tag: link.title }} |
OlderNewer