Skip to content

Instantly share code, notes, and snippets.

@mattaebersold
Created February 11, 2019 22:21
Show Gist options
  • Save mattaebersold/107ad4667e9b6f005b662ee149ad486c to your computer and use it in GitHub Desktop.
Save mattaebersold/107ad4667e9b6f005b662ee149ad486c to your computer and use it in GitHub Desktop.
<section data-section-id="{{ section.id }}" id="header" data-section-type="header" class="header-fixed global-restrict">
{% comment %} Header Announcement {% endcomment %}
{% include 'announcement-bar' %}
{% comment %} Search bar, reveals on click of search icon {% endcomment %}
{% include 'search-bar' %}
{% comment %} Logo and link home {% endcomment %}
<a class="logo" href="/">
<img src="{{ 'logo.svg' | asset_url }}" />
</a>
{% comment %} Desktop Navigation {% endcomment %}
{% include 'navigation' %}
{% comment %} Utility Links (top right of header) {% endcomment %}
<div class="utility-links">
<span class="hide-on-tablet search-toggle" onclick="$('.search-bar').addClass('show'); $('.search-bar input[name=\'q\']').focus();">
<img src="{{ 'icon-header-search.svg' | asset_url }}" />
</span>
{% comment %} Customer Account Link (contextual) {% endcomment %}
{% if shop.customer_accounts_enabled %}
<span class="hide-on-tablet header-item">
{% if customer %}
<a href="/account">
{% else %}
<a href="/account/login">
{% endif %}
<img src="{{ 'icon-header-user.svg' | asset_url }}" />
</a>
</span>
{% endif %}
{% comment %} Mobile Menu grabber with bars that turn into an X {% endcomment %}
<span class="show-on-tablet mobile-menu-toggle header-item">
<i></i>
<i></i>
</span>
{% comment %} Sidebar Cart link {% endcomment %}
<span class="cart-icon" id="quick-cart-trigger">
<img src="{{ 'icon-header-cart.svg' | asset_url }}" />
{% comment %} Cart badge, only show if there are items in the cart {% endcomment %}
<i class="hide cart-count-badge"></i>
</span>
</div>
</section>
{% comment %} Mobile Menu, shows on click of 'mobile-menu-toggle' {% endcomment %}
<nav class="mobile-menu" role="navigation">
{% include 'nav-items', mobile: true %}
</nav>
{% schema %}
{
"name": "Header",
"settings": [
{
"type": "header",
"content": "Header"
},
{
"type": "link_list",
"id": "menu",
"label": "Menu",
"default": "main-menu"
}
]
}
{% endschema %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment