Help Adding Collection Images to New Page Template

Highlighted
New Member
4 0 0

Hello!

I am working on creating a page to show a list of artists/vendors.  So far I have been successful in creating a new page template and displaying the artist/vendor names.  The last step to finalize this is to get an image to show as well.

I have handled this so far by creating each artist/vendor as a collection so there is a collection image available for each one.

Here is the code I used to create the new page template.

 

{% include 'breadcrumb' %}
 
<div class="grid">
 
  <div class="grid-item large--two-thirds push--large--one-sixth">
 
    <h1>{{ page.title }}</h1>
 
    <div class="rte">
          {% assign page_content = page.content %}
          {{ page_content | replace: '[shop_email]', shop.email | replace: '[shop_domain]', shop.domain | replace: '[shop_address]', shop.address.summary | replace: '[shop_name]', shop.name }}
    </div>
 
  </div>
 
</div>
{% assign counter = 0 %}
{% for vendor in shop.vendors %}
{% assign counter = counter | plus: 1 %}
{% endfor %}
 
{% assign counter_divided_by_3 = counter | divided_by: 3 | floor %}
<div class="page-width" style="column-count:5;">
  
  
  {%comment%}
  <div class="content-block">
    <div class="rte rte--indented-images">
      {{ page.content }}
      <div class="grid grid--no-gutters grid-uniform">
          <div class="grid__item small--one-half medium-up--one-fifth">
 
  {%endcomment%}
 
{% for product_vendor in shop.vendors %}
{% assign its_a_match = false %}
{% capture my_collection_handle %} {{ product_vendor | handleize | strip | escape  }} {% endcapture %}
{% assign my_collection_handle_stripped = my_collection_handle | strip | escape %}
 
{% for collection in collections %}
{% if my_collection_handle_stripped == collection.handle %}
{% assign its_a_match = true %}
{% endif %}
{% endfor %}
 
{% if its_a_match %}
<li class="vendor-list-item block-grid"><a async href="/collections/{{ product_vendor | handleize }}">{{ product_vendor }}</a></li>
{% else %}
<li class="vendor-list-item block-grid">{{ product_vendor | link_to_vendor }}</li>
{% endif %}
{% endfor %}
</ul>
0 Likes
 
 
0 Likes