Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hey @LloydSpencer,
sure, not that easy, but still you can get a way around it. 😄
Limitations: My solution works for files, which are stored in pdf. You might need to edit the code if you use other file types.
I saved my file as Color Guide. (Shopify adds underscore instead of space, so I needed to replace the underscore with a space back). Here's my solution:
<ul>
{% for file in product.metafields.custom.file.value %}
{% assign file_name_initial = file.url | split: '/' | last %} <!-- you get the file name with the file format and additional information -->
{% assign file_name_long = file_name_initial | split: '.pdf' | first %} <!-- you get rid of the additional information -->
{% assign file_name = file_name_long | replace: "_", " " %} <!-- you replace underscore with a space -->
<li>
<a href="{{ file.url }}" target="_blank">{{ file_name }}</a>
</li>
{%- endfor -%}
</ul>
And here's how it will be rendered:
Is it what you're looking for?
Let me know if you need further help! 🙂
Learn what's possible with customizing Shopify Checkout beyond what's available out of...
By Shopify Feb 19, 20252m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025