Skip to content

Instantly share code, notes, and snippets.

View carolineschnapp's full-sized avatar

Caroline carolineschnapp

  • Shopify
  • Montreal
View GitHub Profile
@carolineschnapp
carolineschnapp / instructions.md
Last active June 21, 2021 20:39
Handpick your relevant collection for related products using the Custom Fields extension by freakdesign. #metafields
@carolineschnapp
carolineschnapp / page.list-collections.liquid
Last active February 10, 2025 17:40
To add at the bottom of page.list-collections.liquid. In the New Standard theme, use the content of page.full-width.liquid and copy the code at the bottom of that content. This won't work in the Lookbook, Brooklyn, Simple and Kickstand themes.
{% comment %}
Collections are listed here.
{% endcomment %}
{% capture uses_minimal_framework %}{% include 'product-loop' %}{% endcapture %}
{% if uses_minimal_framework contains 'Liquid error' %}
{% assign uses_minimal_framework = false %}
{% assign grid_item_width = 'large--one-quarter medium--one-third small--one-half large--col-3 medium--col-4 small--col-6' %}
{% else %}
@carolineschnapp
carolineschnapp / new_gist_file.html
Created November 8, 2014 16:34
Pagination using numbers in the Minimal theme
{% if paginate.pages > 1 %}
<div class="row">
<div class="span12">
<ul class="pagination clearfix">
{% if paginate.previous %}
<li><a href="{{ paginate.previous.url }}" class="prev">Previous</a></li>
{% else %}
<li><span></span></li>
{% endif %}
{% for part in paginate.parts %}
@carolineschnapp
carolineschnapp / selectors.js
Last active June 21, 2021 20:39
Shopify jQuery selectors.
/*
To test things out, in your JavaScript console, use selector followed by
.css('outline','1px solid red');
to see what you get.
A sandbox to test all this:
https://shopify-selectors.myshopify.com/admin/themes
*/
/*====================================
Product Page and Quick View
@carolineschnapp
carolineschnapp / gist:66aee1dee81203dd464d
Created September 6, 2014 05:10
Classes to show or hide elements based on the screen size.
@media (max-width: 479px) {
.show-on-desktop, .show-on-tablets, .hide-on-mobile { display: none; }
}
@media (min-width: 480px) and (max-width: 979px) {
.show-on-desktop, .hide-on-tablets, .show-on-mobile { display: none; }
}
@media (min-width: 980px) {
.hide-on-desktop, .show-on-tablets, .show-on-mobile { display: none; }
}
@carolineschnapp
carolineschnapp / gist:95cbad99782b26de02d2
Created August 29, 2014 16:30
Title tag internationalization - i18n
<!-- in theme.liquid -->
{% if current_tags %}{% assign meta_tags = current_tags | join: ', ' %}{% endif %}
<title>
{{ page_title }}{% if current_tags %} &ndash; {{ 'general.meta.tagged' | t: tags: meta_tags }}{% endif %}{% if current_page != 1 %} &ndash; {{ 'general.meta.page' | t: page_number: current_page }}{% endif %}{% unless page_title contains shop.name %} &ndash; {{ shop.name }}{% endunless %}
</title>
<!-- in locales/en.default.json -->
{
@carolineschnapp
carolineschnapp / gist:031393b49c8bf0e95ab9
Last active June 21, 2021 20:39
Checkout Theme Settings Sassy CSS variable declerations
/* Checkout theme settings */
// Theme Settings - Checkout
$checkout_use_header_image: {{ settings.checkout_use_header_image }}; // boolean
// checkout_header_image.png // file
$checkout_banner_background_color: {{ settings.checkout_banner_background_color }}; // color
$checkout_logo: {{ settings.checkout_use_logo_image }}; // 3 possible values: 'logo.png', 'checkout_logo.png' or ''.
$checkout_headline: "{{ settings.checkout_headline }}"; // text
$checkout_accent_color: {{ settings.checkout_accent_color }}; // color
@carolineschnapp
carolineschnapp / gist:5c42335e2b50741d18f1
Last active June 21, 2021 20:39
Checkout Next Theme Settings Starter
<fieldset data-overrides-fieldset="checkout">
<legend>Checkout</legend>
<table>
<tr>
<td colspan="2">
<h3>Banner</h3>
</td>
</tr>
<tr class="horizontal">
<th>
@carolineschnapp
carolineschnapp / gist:f73510cdc2946532f68f
Last active June 21, 2021 20:39
BEM - Block-Element-Modifier
<!-- non-BEM -->
<form class="site-search full">
<input type="text" class="field">
<input type="Submit" value ="Search" class="button">
</form>
<style>
.field { } /* specificity: 1 */
.button { } /* specificity: 1 */
@carolineschnapp
carolineschnapp / gist:1172611deb464da84b2d
Last active June 21, 2021 20:39
Not indexing blog pages and collection pages filtered with a tag. Canonical links.
{% if template contains 'collection' and current_tags %}
<meta name="robots" content="noindex" />
<link rel="canonical" href="{{ shop.url }}{{ collection.url }}" />
{% elsif template == 'blog' and current_tags %}
<meta name="robots" content="noindex" />
<link rel="canonical" href="{{ shop.url }}{{ blog.url }}" />
{% else %}
<link rel="canonical" href="{{ canonical_url }}" />
{% endif %}