For loop on blocks does grabs only one out of 3 images

Hello everyone,

I’m pretty fresh in this community. I’m trying to develop a custom section for my friend. The problem is that I used for loop to iterate through blocks. I wanted to assign URLs from image_picker into variables and put them into HTML. Somehow fro loop grabs only one image, the rest stays empty. does anyone know what am I doing wrong? :slightly_smiling_face:

{% for block in section.blocks %}
    {% assign horse_img = block.settings.horse %}
	{% assign prod_btl = block.settings.productBottle %}
    {% assign prod_name = block.settings.productName %} 
{% endfor %}

    

      

        

          

            

          
            
            Read more

        

      

    

    
     

 		
		
      

        
        

      

    

  

{% schema %}
  {
    "name": "PoN custom circle",
    

	"blocks": 	[
				{	"type": "image",
					"name": "Etykieta produktu",
					"settings": [{"type": "image_picker",
									"id": "productBottle",
									"label": "Etykieta produktu"
								}]
				},
				{	"type": "image2",
					"name": "Nazwa produktu",
					"settings": [{"type": "image_picker",
									"id": "productName",
									"label": "nazwa produktu"
								}]
				},
				{	"type": "image3",
					"name": "Zdjęcie konia",
					"settings": [{"type": "image_picker",
									"id": "horse",
									"label": "Zdjęcie konia"
								}]
				}
				],
	"presets":  [
				{
					"category": "PoN custom design",
					"name": "sekcja z kolkami",
					"blocks": [
						{"type": "image"
						},
						{"type": "image3"
						},
						{"type": "image2"
						}
							]
				}
				]
  }
{% endschema %}

@Adameil You need to write your HTML within for loop, something like this

{% for block in section.blocks %}
  {% assign horse_img = block.settings.horse %}
  {% assign prod_btl = block.settings.productBottle %}
  {% assign prod_name = block.settings.productName %} 

  
    

      

        

          

            

          
            
            Read more

        

      

    

    
     

    
    
      

        
        

      

    

  

{% endfor %}

{% schema %}
  {
    "name": "PoN custom circle",
    

  "blocks":   [
        { "type": "image",
          "name": "Etykieta produktu",
          "settings": [{"type": "image_picker",
                  "id": "productBottle",
                  "label": "Etykieta produktu"
                }]
        },
        { "type": "image2",
          "name": "Nazwa produktu",
          "settings": [{"type": "image_picker",
                  "id": "productName",
                  "label": "nazwa produktu"
                }]
        },
        { "type": "image3",
          "name": "Zdjęcie konia",
          "settings": [{"type": "image_picker",
                  "id": "horse",
                  "label": "Zdjęcie konia"
                }]
        }
        ],
  "presets":  [
        {
          "category": "PoN custom design",
          "name": "sekcja z kolkami",
          "blocks": [
            {"type": "image"
            },
            {"type": "image3"
            },
            {"type": "image2"
            }
              ]
        }
        ]
  }
{% endschema %}