Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bjornbennett/21a9dc5bae132b1f7341ee9a4da380e3 to your computer and use it in GitHub Desktop.
Save bjornbennett/21a9dc5bae132b1f7341ee9a4da380e3 to your computer and use it in GitHub Desktop.
Shopify Liquid - With this snippet, you will be able to output multiple custom settings via a For Loop. Useful when you want to output multiple sections
<!-- LOOPS THROUGH SETTINGS VARIABLES, OUTPUTS VIA A FOR-LOOP -->
<div class="container sixteen columns clearfix">
{% for i in (1..7) %}
{% capture tbm_title_setting %}identify_title{{i}}{%endcapture%}
{% capture tbm_content_setting %}identify_content{{i}}{%endcapture%}
{% capture tbm_link_setting %}identify_link{{i}}{%endcapture%}
{% assign tbm_title = settings[tbm_title_setting] %}
{% assign tbm_content = settings[tbm_content_setting] %}
{% assign tbm_link = settings[tbm_link_setting] %}
<div class="eight columns clearfix tbm_identify-block">
<div class="four columns alpha">
<a href="/pages/{{tbm_link}}">
{{tbm_title}}
<p>Click Here To Learn More</p>
</a>
</div>
<div class="four columns omega">
{{tbm_content}}
</div>
</div>
{% endfor %}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment