Shopify themes, liquid, logos, and UX
Hey.
I have crated some multi-line text metafields in product page.
I have a problem adding metafield with PDF file. I've already added product metafield definition, accepted all file types. The metafield is added in admin/product page, where I also uploaded the pdf file. All I need right now is that the metafield shows up in the page as a collabsible tab. When I want to insert dynamic source, all the other text metafieds shows up except for the PDF file. What to do that the metafield with PDF shows up in dynamic source?
can you please share store ulr and metafiles your code
What I forgot to mention that I cannot preview uploaded file at all.
@Liutkut wrote:What I forgot to mention that I cannot preview uploaded file at all.
The file upload dialog only shows previews for image files.
yes, please upload file manage your PDF and link here
I'm assuming you created a File metafield for the PDF, not a multiline text field. Internally, the type of this metafield is file_reference.
As documented here, metafields of that type can only be hooked up as a dynamic source for image pickers, which means they only work for image files, not for PDF files. At least that's what's currently supported, the theme editor may be extended in the future so you could create a download link or something similar for a PDF file.
So to have a download link show up in a collapsible tab you would have to make some modifications to your theme. What you would need is a block that allows custom Liquid code and then you could add a download link to the product's PDF file in the theme editor by adding this code to the Liquid code field of that block:
<a href="{{ product.metafields.my_fields.pdf_file.value.url }}">Download PDF</a>
This code assumes the metafield for the PDF is in the namespace my_fields and the key is pdf_file.
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025