Crerating a Brand page with Vendor Collection Image

I am trying to get my brand page to display the vendor’s collection image. The code I currently have results in all the collection images to display rather than just the vendor ones.

{% for collection in collections %}
      
      {% assign current = "" %}
      {% for product_vendor in shop.vendors %}
        {% assign first_letter = product_vendor | strip_html | upcase | truncate: 1, '' %}
          {% unless first_letter == current %}
        {{ first_letter }}
          {% endunless %}
          - {{ product_vendor }}
                  
                {% endfor %}
              
                
        {% assign current = first_letter %}
      

    {% endfor %}

Hi @JoshSpires ,

First, you need to add collections with the same name as vendor and change the code to:

{% for product_vendor in shop.vendors %}
    {% assign handle = product_vendor | handleize %}
    {% assign collection = collections[handle] %}
    
      - 
    

  {% endfor %}

Hope it helps!

Thanks for the code! It works.

Is it possible to keep the organise by the first letter of the brand in it? So, it easier for customers to find a brand.

Hi @JoshSpires ,

Please change code:

{% for product_vendor in shop.vendors %}
    {% assign handle = product_vendor | handleize %}
    {% assign collection = collections[handle] %}
	{% assign first_letter = product_vendor | strip_html | upcase | truncate: 1, '' %}
    
      - {{ first_letter }}
        
          
        
      
    

  {% endfor %}

If it helped you solve your issue, please mark it as a solution. Thank you and good luck.