1. Eine Navigation erstellen mit menu-COLLECTION_HANDLE
Folgendes Codeschnippet oben im collection.liquid Template
1 2 3 4 5 6 7 8 9 10 11 12 |
{%- assign submenu_handle = 'menu-' |append:collection.handle -%} {%- assign request_last = request.path | split: '/' | last -%} {%- if linklists[submenu_handle].links != blank -%} <hr class="mt__15 mb__10"> <div class="row fl_center"> {%- for link in linklists[submenu_handle].links -%} {%- assign url_last = link.url | split: '/' | last -%} <a href="{{ link.url }}" class="button {% if url_last != request_last %}button_primary{% endif %} active ml__4 mr__4 mb__5" style="padding-left:10px; padding-right:10px; ">{{ link.title }}</a> {%- endfor -%} </div> <hr class="mt__5 mb__10"> {%- endif -%} |