How can I link specific files (pdf documents) to specific products? on Dawn Theme

Hello, I want to have a dropdown box on my products which shows a link to a set of installation instructions. I have a collapsible row on my product page, and I have created a metafield for file (see image below)

but when I go to add the metafield into the “row content” section of the Collapsible Row the metafield for files is not listed as an option to add (see image below).

I can use the “Insert Link” option in the row content box, however, I have multiple sets of different install instructions for my different products and the “insert link” adds the file to all products which I don’t want.

Is there a way for me to use metafields to link specific files to specific products? Or some other way for me to achieve this? I have zero coding experience or knowledge so the above two ways have been the only ways I’ve know how to attempt this based on Shopify’s help guides regarding linking files.

Hi @peter_vw

I don’t see Shopify support schema for file type here ( just support video & image). So I suggest you code below:

  1. Go to Store Online-> theme → edit code

  1. Sections/main-product.liquid

  2. Add a code below to schema

{
      "type": "installation",
      "name": "installation",
       "settings": []
    },

  1. find “{%- for block in section.blocks -%}” after that add code below likes the screenshot
{%- when 'installation' -%}
             

Installation Guide

Hi @peter_vw ,

Would request you to refer to the below video to implement the same.

hari1_prasad_0-1678139760942.gif

Hope it helps…

1 Like

Hi @EBOOST , thank you for your reply.

I’ve added the code as per your screenshots, however, I can’t see any difference to my products page. I still can’t add my file metafield to the Collapsible Row of the product page on the theme, and when I add a file to the metafield section on the actual product that file doesn’t appear anywhere.

Hi @gr_trading , thanks for taking the time to reply with such a detailed video response. That code works to create a hyperlink to add individual files to. Is there a way to put that code into a drop-down collapse row box?

@peter_vw I’m sorry to say apart from the custom liquid you only have the option to edit the theme code.

1 Like

Hi @peter_vw ,

I noticed that you’re looking for an easier way to add specific files to specific products, and I wanted to share some advice that might help you out.

The Free Ease Product Attachments App is a great tool that can allow you to upload your files (whether they’re PDFs or other formats), and assign them to all products, certain products, or collections without any coding knowledge required.

Once you’ve done this, you can easily create a separate section or block of your files on the product page template, and the app will automatically show your uploaded files on the product pages that you assigned them to. It’s really that simple!

I think that you’ll find the Ease Product Attachments App to be a helpful tool for your store. So why not give it a try and see how it can make your file management much easier :blush: ?

Is there a way to edit the title “product attachments”