Last active
November 13, 2015 15:58
-
-
Save mig1098/2758d2d4546a1ff5a18c to your computer and use it in GitHub Desktop.
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
<ul id="main-menu" class="accordion"> | |
{% for link in linklists.main-menu.links %} | |
{% assign has_sub_menu = false %} | |
{% assign parent_link_active = false %} | |
{% assign child_list_handle = link.title | handle %} | |
{% if linklists[child_list_handle] and linklists[child_list_handle].links.size > 0 %} | |
{% assign has_sub_menu = true %} | |
{% for l in linklists[child_list_handle].links %} | |
{% if l.active %} | |
{% assign parent_link_active = true %} | |
{% endif %} | |
{% endfor %} | |
{% endif %} | |
{% if has_sub_menu %} | |
<li> | |
<a href="#" class="accordion-button">{{ link.title }} | |
<span>{% if link.active or parent_link_active %}-{% else %}+{% endif %}</span> | |
</a> | |
<div class="accordion-content" {% unless parent_link_active %}style="display:none"{% endunless %} > | |
{% for l in linklists[child_list_handle].links %} | |
{% comment %} | |
-- validate sub list dropdown mig1098 -- | |
{% endcomment %} | |
{% assign mg_has_sub_menu = false %} | |
{% assign mg_parent_link_active = false %} | |
{% assign mg_child_list_handle = l.title | handle %} | |
{% if linklists[mg_child_list_handle] and linklists[mg_child_list_handle].links.size > 0 %} | |
{% assign mg_has_sub_menu = true %} | |
{% for childlink2 in linklists[mg_child_list_handle].links %} | |
{% if childlink2.active %} | |
{% assign mg_parent_link_active = true %} | |
{% endif %} | |
{% endfor %} | |
{% endif %} | |
{% if mg_has_sub_menu %} | |
<a href="#" class="accordion-button {% if l.active %}active{% endif %}" >{{ l.title }} | |
<span>{% if l.active or mg_parent_link_active %}-{% else %}+{% endif %}</span> | |
</a> | |
<div class="accordion-content" {% unless mg_parent_link_active %}style="display:none"{% endunless %} > | |
{% comment %} | |
-- create sub list dropdown mig1098 -- | |
{% endcomment %} | |
{% assign mg_child = l.title | handleize %} | |
{% if linklists[mg_child].links != blank %} | |
<ul class="accordion mg-dropdown"> | |
{% for childlink2 in linklists[mg_child].links %} | |
<li> | |
<a href="{{ childlink2.url }}" {% if childlink2.active %}class="active"{% endif %}>{{ childlink2.title | escape }}</a> | |
</li> | |
{% endfor %} | |
</ul> | |
{% endif %} | |
</div> | |
{% else %} | |
<a href="{{ l.url }}" {% if l.active %}class="active"{% endif %}>{{ l.title }} </a> | |
{% endif %} | |
{% endfor %} | |
</div> | |
</li> | |
{% else %} | |
<li><a href="{{ link.url }}">{{ link.title }}</a></li> | |
{% endif %} | |
{% endfor %} | |
{% if shop.customer_accounts_enabled %} | |
{% if customer %} | |
<li class="mobile"><a href="/account">{{ 'customer.account.your_account' | t }}</a></li> | |
<li class="mobile">{{ 'customer.account.log_out' | t | customer_logout_link }}</li> | |
{% else %} | |
<li class="mobile">{{ 'customer.account.log_in' | t | customer_login_link }}</li> | |
{% if shop.customer_accounts_optional %} | |
<li class="mobile">{{ 'customer.account.create_account' | t | customer_register_link }}</li> | |
{% endif %} | |
{% endif %} | |
{% endif %} | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment