Created
February 17, 2017 18:52
-
-
Save kellyvaughn/311ec04ab8b7c14215d5f386671bc63c to your computer and use it in GitHub Desktop.
Sections/Snippets - Page Headers
This file contains hidden or 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
| <div class="page-header" style="background-image: url({{ settings.general-header | img_url: 'master' }})"> | |
| {{ settings.general-header | img_url: 'master' | img_tag }} | |
| <h1>{{ page_title }}</h1> | |
| </div> |
This file contains hidden or 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
| <div class="page-header {{ block.shopify_attributes }}" style="background-image: url({{ block.settings.image | img_url: 'master' }})"> | |
| {{ block.settings.image | img_url: 'master' | img_tag }} | |
| <h1>{{ page.title }}</h1> | |
| </div> |
This file contains hidden or 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
| {% assign found_match = false %} | |
| {% for block in section.blocks %} | |
| {% assign title = block.settings.page %} | |
| {% if page.handle == title %} | |
| {% assign found_match = true %} | |
| {% include 'page-header' %} | |
| {% endif %} | |
| {% endfor %} | |
| {% if found_match == false %} | |
| {% include 'general-header' %} | |
| {% endif %} | |
| {% schema %} | |
| { | |
| "name": "Page Headers", | |
| "settings": [ | |
| { | |
| "type": "image_picker", | |
| "id": "general-header", | |
| "label": "General Header Image" | |
| } | |
| ], | |
| "blocks": [ | |
| { | |
| "type": "headers", | |
| "name": "Headers", | |
| "settings": [ | |
| { | |
| "type": "page", | |
| "id": "page", | |
| "label": "Page" | |
| }, | |
| { | |
| "type": "image_picker", | |
| "id": "image", | |
| "label": "Header Image" | |
| } | |
| ] | |
| } | |
| ] | |
| } | |
| {% endschema %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment