How to Get File URL in Shopify

If you wish to search out the address link to a selected file, don’t worry, Liquid incorporates a filter which will assist you to go looking for a link quickly. The liquid in Shopify permits you to do loads of tasks to save lots of time on uploading content on the website.

The tutorial focuses on a way to get file address in Shopify

What is Liquid

Liquid is a template language created by Shopify. It’s available as an open source project on GitHub, and is used by many different software projects and companies. This reference documents the Liquid tags, filters, and objects that you can use to build Shopify Themes.

What is a file URL

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

How to Get File URL in Shopify

The URL of a file is returned in the page you post this code on it files page by File URL.

1- Go to the online store > Theme >Edit Code

change menu on shopfiy store

2- add your this code change ‘size-chart.pdf’ to you file name you want to show on it

the file should end with .liquid

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

Result :

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.

Leave a Comment