cybko
June 19, 2022, 7:41am
1
After fixing an issue with children displaying incorrectly
I still have an issue with chevrons pointing all over the place when they should all be pointing down.
Seems there is something in Impulse marking these branches as open and they aren’t being initialised properly in the code. How can I make sure they are properly initialised on render?
Hi @cybko ,
Please change all code:
{%- assign animation_row = 1 -%}
{%- assign drawer_position = 'right' -%}
{% if logo_alignment == 'center' %}
{%- assign drawer_position = 'left' -%}
{% endif %}
{%- for link in main_menu.links -%}
{%- assign animation_row = animation_row | plus: 1 -%}
{%- assign child_list_handle = link.url | handleize | append: forloop.index -%}
{%- assign has_dropdown = false -%}
{%- if link.links != blank -%}
{%- assign has_dropdown = true -%}
{%- endif -%}
- {%- if has_dropdown -%}
{%- if link.url == '#' -%}
{%- else -%}
{{ link.title }}
{%- endif -%}
{%- else -%}
{{ link.title }}
{%- endif -%}
{%- if has_dropdown -%}
{%- for childlink in link.links -%}
{%- assign has_sub_dropdown = false -%}
{%- assign grand_child_list_handle = childlink.url | handleize | append: forloop.index -%}
{%- if childlink.links != blank -%}
{%- assign has_sub_dropdown = true -%}
{%- endif -%}
- {%- if childlink.url == '#' and has_sub_dropdown -%}
{%- else -%}
{% if childlink.active %}data-active="true"{% endif %}
{{ childlink.title | escape }}
{%- endif -%}
{%- if childlink.url != '#' and has_sub_dropdown -%}
{%- endif -%}
{%- if has_sub_dropdown -%}
{%- for grandchildlink in childlink.links -%}
- {% if grandchildlink.active %} data-active="true"{% endif %}
{{ grandchildlink.title }}
{%- endfor -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endfor -%}
{%- assign have_secondary_list = false -%}
{%- if section.settings.toolbar_menu != blank or shop.customer_accounts_enabled -%}
{%- assign have_secondary_list = true -%}
{%- endif -%}
{%- if have_secondary_list -%}
- {%- if section.settings.toolbar_menu != blank -%}
{%- for link in toolbar_menu.links -%}
{%- assign animation_row = animation_row | plus: 1 -%}
{{ link.title }}
{%- endfor -%}
{%- endif -%}
{%- if shop.customer_accounts_enabled -%}
{%- assign animation_row = animation_row | plus: 1 -%}
{%- if customer -%}
{{ 'layout.customer.account' | t }}
{%- else -%}
{{ 'layout.customer.log_in' | t }}
{%- endif -%}
{%- endif -%}
{%- endif -%}
{%- assign animation_row = animation_row | plus: 1 -%}
{%- if settings.social_instagram_link != blank -%}
- Instagram
{%- endif -%}
{%- if settings.social_facebook_link != blank -%}
- Facebook
{%- endif -%}
{%- if settings.social_youtube_link != blank -%}
- YouTube
{%- endif -%}
{%- if settings.social_twitter_link != blank -%}
- Twitter
{%- endif -%}
{%- if settings.social_pinterest_link != blank -%}
- Pinterest
{%- endif -%}
{%- if settings.social_snapchat_link != blank -%}
- Snapchat
{%- endif -%}
{%- if settings.social_tiktok_link != blank -%}
- TikTok
{%- endif -%}
{%- if settings.social_tumblr_link != blank -%}
- Tumblr
{%- endif -%}
{%- if settings.social_linkedin_link != blank -%}
- LinkedIn
{%- endif -%}
{%- if settings.social_vimeo_link != blank -%}
- Vimeo
{%- endif -%}
Hope it helps!
1 Like
cybko
June 20, 2022, 7:55am
3
Amazing. Thank you so much!
1 Like