Home > Shopify Development > Liquid file_url: How to Get File URL in Shopify

How to Get File URL in Shopify

Sam Nguyen
Sam Updated: July 28, 2024

Share:

Drive 20-40% of your revenue with Avada
avada email marketing

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.


Sam Nguyen is the CEO and founder of Avada Commerce, an e-commerce solution provider headquartered in Singapore. He is an expert on the Shopify e-commerce platform for online stores and retail point-of-sale systems. Sam loves talking about e-commerce and he aims to help over a million online businesses grow and thrive.

Stay in the know

Get special offers on the latest news from AVADA.