How can I use a liquid loop to replace blocks with a SKU list?

I created a section that is a simple dropdown.

It’s a dropdown list of blocks with a title, a URL for file download, and a button that downloads the selected item. Right now I have it built as blocks, BUT I want to change it to loop through a metafield list.

Basically, the question is this:

How do I write a liquid loop that will replace the blocks with a list of SKUs and when click, it will download the metafield file associated with it?

Hello @DavidCab

Do you want to set any download files for each product (like the product catalog)?

Yes, i already have a working section that uses individual blocks for each file. I want to change it from using blocks to using the metefield product.metafields.product-files.manual and the product SKU as the title.

Right now the code for the inner part of dropdown including button is this.


        
      

    {% endif %}