Skip to content

Instantly share code, notes, and snippets.

View whistlerbrad's full-sized avatar

Brad whistlerbrad

View GitHub Profile
@whistlerbrad
whistlerbrad / index-page-full
Last active September 27, 2017 03:40
Full width video page for home
<!-- /sections/index-page-full.liquid -->
<div class="homepage-page {{ section.settings.homepage_page_color }}" data-section-id="{{ section.id }}" data-section-type="index-page">
{% for block in section.blocks %}
<div class="grid">
{% case block.type %}
{% when 'page' %}
{% if block.settings.home_page_content != blank %}
{% assign page = pages[block.settings.home_page_content] %}
@whistlerbrad
whistlerbrad / collection-no-banner.liquid
Last active May 31, 2018 01:50
Use this when adding a custom collection banner
<!-- /sections/collection-no-banner.liquid -->
{%- assign grid_offset = '' -%}
{%- assign products_count = collection.products_count -%}
{%- case section.settings.grid_setting_large -%}
{%- when 1 -%}
{%- assign grid_width_large = 'large--one-whole' -%}
{%- when 2 -%}
{%- assign grid_width_large = 'large--one-half' -%}
{%- if products_count == 1 -%}
@whistlerbrad
whistlerbrad / collection-template.liquid
Created September 27, 2017 18:48
Template when using collection with no banner and custom banner
{% section 'collection-custom' %}
{% section 'collection-no-banner' %}
{%- if section.settings.image -%}
{%- assign background_image = section.settings.image | img_url: '1800x' -%}
{%- else -%}
{%- assign background_image = 'blank.svg' | asset_url -%}
{%- endif -%}
<div class="homepage-image preventOverflow {{ section.settings.height }} {{ section.settings.color }}" data-section-id="{{ section.id }}" data-section-type="banner" {% if section.settings.parallax %}data-img-src="{{ background_image }}"{% endif %}>
{% if section.settings.link_text == '' and section.settings.link and section.settings.button_image == nil %}
<a href="{{ section.settings.link }}">
{% endif %}
<div class="content--centered">
@whistlerbrad
whistlerbrad / collection-alternate.liquid
Last active September 27, 2017 23:15
Pipeline 1.6 Collection template with description below and center
{% paginate collection.products by 48 %}
{% if collection.image %}<div class="collection-image" style="background-image: url('{{ collection.image | img_url: '2048x2048' }}');"> {% endif %}
<div class="collection-title text-center">
<div class="grid">
<h1 class="collection-text--headline title grid__item one-whole">{{ collection.title }}</h1>
</div>
</div>
{% if collection.image %}<div class="collection-image-overlay"></div>
</div>
@whistlerbrad
whistlerbrad / collection-alternate-left.liquid
Created September 27, 2017 23:16
Pipeline 1.6 Collection description below left justified.
{% paginate collection.products by 48 %}
{% if collection.image %}<div class="collection-image" style="background-image: url('{{ collection.image | img_url: '2048x2048' }}');"> {% endif %}
<div class="collection-title text-center">
<div class="grid">
<h1 class="collection-text--headline title grid__item one-whole">{{ collection.title }}</h1>
</div>
</div>
{% if collection.image %}<div class="collection-image-overlay"></div>
</div>
@whistlerbrad
whistlerbrad / product.liquid
Created September 29, 2017 18:08
Fresh 3.0 for snippets folder
<!-- /snippets/product.liquid -->
{% if product.template_suffix contains "charge-rabbit" %}
{% assign form_action = product.metafields.charge_rabbit.subscribe_path %}
{% assign form_method = 'get'%}
{% assign form_class = "charge-rabbit-product" %}
{% assign include_customer_id = true %}
{% assign membership_product = true %}
{% else %}
{% assign form_action = '/cart/add' %}
{% assign form_method = 'post'%}
@whistlerbrad
whistlerbrad / collection-full-width-description
Created October 2, 2017 02:52
Pipeline 3 full-width description
<!-- /sections/collection.liquid -->
{%- assign grid_offset = '' -%}
{%- assign products_count = collection.products_count -%}
{%- case section.settings.grid_setting_large -%}
{%- when 1 -%}
{%- assign grid_width_large = 'large--one-whole' -%}
{%- when 2 -%}
{%- assign grid_width_large = 'large--one-half' -%}
{%- if products_count == 1 -%}
@whistlerbrad
whistlerbrad / index-banner-image-mobile.liquid
Last active January 12, 2018 00:17
Height support for separate mobile image
{%- if section.settings.image -%}
{%- assign background_image = section.settings.image | img_url: '1800x' -%}
{%- else -%}
{%- assign background_image = 'blank.svg' | asset_url -%}
{%- endif -%}
<div class="homepage-image homepage-image-{{ section.id }} preventOverflow {{ section.settings.height }} {{ section.settings.color }}" data-section-id="{{ section.id }}" data-section-type="banner" {% if section.settings.parallax %}data-img-src="{{ background_image }}"{% endif %}>
{% if section.settings.link_text == '' and section.settings.link and section.settings.button_image == nil %}
<a href="{{ section.settings.link }}">
{% endif %}
<div class="content--centered">
@whistlerbrad
whistlerbrad / product.liquid
Created October 2, 2017 22:37
Snippets - Not for Sale version
<!-- /snippets/product.liquid -->
{% if product.template_suffix contains "charge-rabbit" %}
{% assign form_action = product.metafields.charge_rabbit.subscribe_path %}
{% assign form_method = 'get'%}
{% assign form_class = "charge-rabbit-product" %}
{% assign include_customer_id = true %}
{% assign membership_product = true %}
{% else %}
{% assign form_action = '/cart/add' %}
{% assign not_for_sale = 0 %}