I have a section .liquid template that I want to be able to repeat multiple times on a non-homepage template with different content each time.
The only solution I was able to find would be to creating multiple files (i.e. section/file-1.liquid, section/file-2.liquid) with the same code. However, from a mainainablity standpoint this is far less than ideal.
Basically, I want to be able to do the following with unique content each time the section is called:
<section class="grid-x">
{% for index in (1..2) %}
<div class="cell small-12 medium-large-6">
{% section 'custom-section' %}
</div>
{% endfor %}
</section>
And have my section file do something like this:
{% assign list = section.blocks %}
<section>
{% if section.settings.title %}
<h2>{{ section.settings.title }}</h2>
{% endif %}
<ul>
{% for item in list %}
{% if item.settings.title %}
<li>
{% if item.settings.icon %}
<span class="icon-area" aria-hidden="true">
<i class="icon icon-{{ item.settings.icon }}"></i>
</span>
<span>{{ item.settings.title }}</span>
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
</section>
And that section to appear twice on one page and again on another page with different content in each.
Is this possible? Is there any way to do this?