FROM CACHE - en_header

How to use linklist in a template file?

Kesey_Badgett
New Member
6 0 0

I would like to give website managers the ability to easily edit a custom html/liquid banner element using the customizer. Specifically, using a link list dropdown. 

 

 {
        "type": "link_list",
        "id": "button_link",
        "label": "Button Link"
      }

Here is the liquid in settings-schema, but what do I need to put in my template file to actually get this information to do something?

 

 

Replies 3 (3)
Alex60
Excursionist
23 0 11

The code below will output the handle of the link list.

{{ settings.button_link }}

The code below will output the link list as an object.

linklists[settings.button_link]

Below is an example of outputting the links within the list.

{% for link in linklists[settings.button_link].links %}
  <a href="{{ link.url }}">{{ link.title }}</a>
{% endfor %}

 

Kesey_Badgett
New Member
6 0 0

You're a genius. Thank you so much.

FS-Matt
Tourist
7 0 1

Bacon saved!

this is the stuff that should be in the shopify docs