Created
July 26, 2021 21:01
-
-
Save devdarren7/2ab855632cf71c672ac3ece42f556687 to your computer and use it in GitHub Desktop.
Dawn assign collection to linklist
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
| {% if linklists[settings.sidebar_linklist_1].links.size == 0 %} | |
| <div class="section-header"> | |
| <p class="section-header__title h4">Shop by Collection</p> | |
| </div> | |
| {{ 'layout.sidebar_onboarding.shop_by_collection_description_html' | t }} | |
| {% endif %} | |
| {% for i in (1..5) %} | |
| {% capture setting_key %}sidebar_linklist_{{ i }}{% endcapture %} | |
| {% assign sidebar_linklist_handle = settings[setting_key] %} | |
| {% if linklists[sidebar_linklist_handle].links.size > 0 %} | |
| <nav class="sidebar-module fl_panel fl_collections-list"> | |
| <div class="section-header"> | |
| <p class="section-header__title h4"><img src="{{ 'col_headline.png' | asset_url }}" class="headline" alt="{{ linklists[sidebar_linklist_handle].title }}" />{{ linklists[sidebar_linklist_handle].title }}</p> | |
| </div> | |
| <ul class="sidebar-module__list"> | |
| {% for link in linklists[sidebar_linklist_handle].links %} | |
| <li class="js-collection-parent {{ link.object.title}} js-hover-menu sidebar-sublist{% if link.url == active_url %} is-active{% endif %}"> | |
| <div class="sidebar-sublist__trigger-wrap "> | |
| <a href="{{ link.active }}" class="sidebar-sublist__has-dropdown {{ link.handle }} {% unless template == 'index' %}{% if link.url == active_url %} is-active{% endif %}{% endunless %}"> | |
| {% assign linkCollection = link.object %} | |
| {% if linkCollection.image %} | |
| <img src="{{ linkCollection.image.src | collection_img_url: 'large' }}" alt="{{ linkCollection.title | escape }}" /> | |
| {% else %} | |
| <img src="{{ linkCollection.products.first.featured_image.src | product_img_url: 'large' }}" alt="{{ linkCollection.title | escape }}" /> | |
| {% endif %} | |
| {{ link.title }} | |
| <span class="right">»</span></a> | |
| </div> | |
| </li> | |
| {% endfor %} | |
| </ul> | |
| </nav> | |
| {% endif %} | |
| {% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment