Hi guys, I'm new to this forum and don't entirely know the formatting, so please forgive me if anything is incorrect.
Basically, I have a pile of code for a dropdown menu I'm trying to use for my Shopify website to create a dropdown menu, as currently it's invisible and doesn't show anything.
I'm not sure which part of the code is the issue, and it says not to copy and paste huge blocks, so I'm not sure how exactly to go about this.
Any and all help would be appreciated, thanks!
[CODE title="dropdown-menu.liquid"]<ul class="site-nav-dropdown">
{% for childlink in linklists[link_child].links %}
<li {% if linklists[childlink.handle] != empty %}class="dropdown"{% endif %}>
<a href="{{ childlink.url }}" class="{% if childlink.active %}current{% endif %}">
<span>
{{ childlink.title | escape }}
</span>
{% if linklists[childlink.handle] != empty %}<i class="fa fa-caret-right"></i>{% endif %}
</a>
<ul class="site-nav-dropdown">
{% for childlink2 in linklists[childlink.handle].links %}
<li {% if linklists[childlink2.handle] != empty %}class="dropdown"{% endif %}>
<a href="{{ childlink2.url }}" class="{% if childlink2.active %}current{% endif %}">
<span>
{{ childlink2.title | escape }}
</span>
{% if linklists[childlink2.handle] != empty %}<i class="fa fa-caret-right"></i>{% endif %}
</a>
<ul class="site-nav-dropdown">
{% for childlink3 in linklists[childlink2.handle].links %}
<li>
<a href="{{ childlink3.url }}" class="{% if link.active %}current{% endif %}">
<span>
{{ childlink3.title | escape }}
</span>
</a>
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>[/CODE]
Basically, I have a pile of code for a dropdown menu I'm trying to use for my Shopify website to create a dropdown menu, as currently it's invisible and doesn't show anything.
I'm not sure which part of the code is the issue, and it says not to copy and paste huge blocks, so I'm not sure how exactly to go about this.
Any and all help would be appreciated, thanks!
[CODE title="dropdown-menu.liquid"]<ul class="site-nav-dropdown">
{% for childlink in linklists[link_child].links %}
<li {% if linklists[childlink.handle] != empty %}class="dropdown"{% endif %}>
<a href="{{ childlink.url }}" class="{% if childlink.active %}current{% endif %}">
<span>
{{ childlink.title | escape }}
</span>
{% if linklists[childlink.handle] != empty %}<i class="fa fa-caret-right"></i>{% endif %}
</a>
<ul class="site-nav-dropdown">
{% for childlink2 in linklists[childlink.handle].links %}
<li {% if linklists[childlink2.handle] != empty %}class="dropdown"{% endif %}>
<a href="{{ childlink2.url }}" class="{% if childlink2.active %}current{% endif %}">
<span>
{{ childlink2.title | escape }}
</span>
{% if linklists[childlink2.handle] != empty %}<i class="fa fa-caret-right"></i>{% endif %}
</a>
<ul class="site-nav-dropdown">
{% for childlink3 in linklists[childlink2.handle].links %}
<li>
<a href="{{ childlink3.url }}" class="{% if link.active %}current{% endif %}">
<span>
{{ childlink3.title | escape }}
</span>
</a>
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>[/CODE]