Skip to content

Instantly share code, notes, and snippets.

Avatar

Shopify Partners shopifypartners

View GitHub Profile
@shopifypartners
shopifypartners / basic-markup.liquid
Created Oct 25, 2019
How to Create a Customizable Announcement Bar Section
View basic-markup.liquid
{%- if section.settings.show_announcement -%}
{%- if section.settings.home_page_only == false or template.name == 'index' -%}
<div class="announcement-bar">
<p class="announcement-bar__message"></p>
</div>
{%- endif -%}
{%- endif -%}
View nested-navigation-link-list-for-loop.liquid
View nested-navigation-link-list-three-levels.liquid
View nested-navigation-link-list-full-snippet.liquid
View accessible-pagination.liquid
{%- paginate blog.articles by 5 -%}
{%- for article in blog.articles -%}
<!-- show blog article details here -->
{%- endfor -%}
{%- if paginate.pages > 1 -%}
<nav role="navigation">
<ol class="pagination">
{%- if paginate.previous-%}
<li>
View relative-pagination.rb
products = ShopifyAPI::Product.find(:all, params: { order: 'inventory_total desc', limit: 250 })
process_products(products)
3.times do
break unless products.next_page?
products = products.fetch_next_page
process_products(products)
end
View a-beginners-guide-to-sass-part-3-interpolation.liquid.scss
// Escaping Liquid in SCSS.
//
// Expected output:
// a{
// color: {{ settings.link-color }};
// }
a{
color: #{'{{ settings.link-color }}'};
}
View accessible-breadcrumbs.liquid
{% unless template == 'index' or template == 'cart' or template == 'list-collections' or template == '404' %}
{% assign t = template | split: '.' | first %}
<nav class="breadcrumbs" role="navigation" aria-label="breadcrumbs">
<ol>
<li>
<a href="/" title="Home">Home</a>
</li>
View shopify-scripts-multiple-components-one-scripts-example.rb
# Use an array to keep track of the discount campaigns desired.
CAMPAIGNS = [
# $5 off all items with the "sale" tag
ItemCampaign.new(
AndSelector.new(
TagSelector.new("sale"),
ExcludeGiftCardSelector.new,
),
MoneyDiscount.new(5_00, "5$ off all items on sale",),
),
You can’t perform that action at this time.