Skip to content

Instantly share code, notes, and snippets.

@shopifypartners
shopifypartners / colour-setting.liquid
Created October 25, 2019 15:57
How to Create a Customizable Announcement Bar Section
{
"type": "color",
"id": "announcement_bar_color",
"label": "Background color",
"default": "#000000"
},
@shopifypartners
shopifypartners / text-link-section-settings.liquid
Created October 25, 2019 15:53
How to Create a Customizable Announcement Bar Section
@shopifypartners
shopifypartners / content-options.liquid
Created October 25, 2019 15:46
How to Create a Customizable Announcement Bar Section
{%- if section.settings.link == blank -%}
<div class="announcement-bar">
{%- else -%}
<a href="{{ section.settings.link }}" >
{%- endif -%}
<p class="announcement-bar__message">{{ section.settings.text | escape }}</p>
{%- if section.settings.link == blank -%}
</div>
@shopifypartners
shopifypartners / schema-checkbox-settings.liquid
Created October 25, 2019 15:40
How to Create a Customizable Announcement Bar Section
{% schema %}
{
"name": "Announcement bar",
"settings": [
{
"type": "checkbox",
"id": "show_announcement",
"label": "Show announcement",
"default": false
},
@shopifypartners
shopifypartners / basic-markup.liquid
Created October 25, 2019 15:24
How to Create a Customizable Announcement Bar Section
{%- 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 -%}
.image-container {
display: -ms-grid;
display: grid;
grid-gap: 30px;
-ms-grid-columns: 200px 30px auto;
grid-template-columns: 480px auto;
}
.image-details {
position: relative;
new Drift(document.querySelector('.image-zoom'), {
paneContainer: document.querySelector('.image-details')
});
<div class=”image-container”>
<img class=”image-zoom” src=”{{ featured_image | img_url: '480x480' }}” alt="{{ image.alt | escape }} data-zoom="{{ featured_image | img_url: '1024x1024', scale: 2 }}>
<div class="image-details"></div>
</div>
@shopifypartners
shopifypartners / label-language-settings.json
Created September 25, 2019 07:24
How to use Shopify theme settings to create mobile-specific logos |
"label": {
"de": "Logo-Foto",
"en": "Logo image",
"es": "Logotipo",
"fr": "Image du logo",
"it": "Immagine del logo",
"ja": "ロゴ画像",
"pt-BR": "Imagem do logotipo"
}