Hosted file Filters
Hosted file filters provide URLs for assets stored on the Shopify CDN, such as files uploaded through the Shopify admin.
asset_img_url
Gets the CDN URL for an image located in the theme's assets directory.
{{ 'red-and-black-bramble-berries.jpg' | asset_img_url }}
size
The asset_img_url
filter usually gives a small image (100 x 100 px). You can choose a different size if you want.
image | asset_img_url : string
asset_url
Provides the CDN link for a file located in the theme's assets directory.
string | asset_url
file_img_url
Returns the URL for an image hosted on Shopify's CDN from the Files page in the Shopify admin.
string | file_img_url
returns string
The size parameter
By default, the file_img_url filter shows the small version of the image (100 x 100 px). You can choose a different size if needed.
image | file_img_url : string
file_url
Returns the content delivery network (CDN) URL for a file from the Files page of the Shopify admin.
string | file_url
global_asset_url
string | global_asset_url
Returns the CDN URL for a global asset.
Global assets are stored in a directory on Shopify's server. Using global assets can be faster than loading the resource directly.
Depending on the type of resource, you may need to apply an additional filter to load it correctly. The table below lists which filter to use for specific resource types:
Resource Type | Additional Filter |
---|---|
JavaScript (.js) | script_tag |
CSS (.css) | stylesheet_tag |
The following table lists the global assets available:
Category | Assets |
---|---|
Firebug |
|
JavaScript libraries |
|
Lightbox |
|
Prototype |
|
script.aculo.us |
|
Shopify |
|
shopify_asset_url
string | shopify_asset_url
Returns the CDN URL for a globally accessible Shopify asset.
- option_selection.js
- api.jquery.js
- shopify_common.js
- customer_area.js
- currencies.js
- customer.css