How to Get File URL in Shopify

If you want to find the URL link to a specific file, do not worry, Liquid has a filter that can help you to search a link quickly. Liquid in Shopify lets you do a lot of tasks to save time on uploading content on the website. The tutorial focuses on a method to get file url in Shopify.

Table of content

What is Liquid

Since 2006, Liquid has been the backbone language of Shopify and has been trusted by a lot of web developers. Liquid is one of the open-source template languages in Shopify. The template has been sold since 2006 and now become a good source for a lot of hosted website application such as Jekyll, salesforce desk, and zendesk.

Filter is one of the four Liquid references including filter, objects, basics and tags. Filters are simple methods that modify the output of numbers, strings, variables, and objects. Filters are placed between an output tag and are denoted by a pipe character.

What is file URL

URL filters generate links to assets Shopify’s Content Delivery Network. Links for filtering collections and blogs are also created using this filters. Besides, in many URL filter links, you will see a question mark with a number followed the asset’s file path. For example:

How to Get File URL in Shopify

The URL of a file is returned in the admin’s files page by File URL.

Input


{{ 'size-chart.pdf' | file_url }}

Output


//cdn.shopify.com/s/files/1/0087/0462/files/size-chart.pdf?28261

Conclusion

To sum up, file URL helps you to find out folders easily. Liquid supports you to use URL filter to track information under link form. We hope that you will seek out the most suitable way to search your folder. Let us know your difficulties if you have problems with the formula. We will address them.