In Liquid is it possible to assign a var to combine two linklists, for example:
{% if section.settings.main_linklist == blank and section.settings.top_bar_linklist != blank %}
{% assign navMobile = linklists[section.settings.top_bar_linklist] %}
{% else %}
{% assign navMobile = linklists[section.settings.main_linklist] %}
{% endif %}
I want the second assign to be something like:
{% assign navMobile = linklists[section.settings.main_linklist] and linklists[section.settings.top_bar_linklist] %}
2
Answers
You can append the links with a hook of some kind between them.
For example:
Afterwards you can split them by “|” and get yourself an array.
There is no other way to save two links in a single variable in liquid.
You may use a concat function.
Not tested but something like that should work:
Then you’ll be able to loop through your new array: