How to Get Global Asset URL in Shopify
Last updated: October 07 2024
In Shopify, efficiently managing your store’s assets is essential for ensuring smooth operation and an optimized user experience. The Liquid global_asset_url filter is a powerful tool that helps you get the global asset URL for any resource within your store’s theme. By mastering this feature, you can streamline your store’s performance and easily manage assets. In this article, we’ll break down how to effectively use global_asset_url to keep your store’s assets organized and accessible, ensuring your site runs smoothly.
How to Get Global Asset URL in Shopify
About Global Asset URL in Shopify {#about-global-asset-url}
By permitting or denying access to a website, the URL filters are considered as the best way to control access to Internet websites. In addition, based on information which is contained in the list of URL, the users can store this list on Websense or Secure Computing URL filter. Besides, internet users enable maintaining the local URL as well as create the link for collection filters and blogs. In many URL filter outputs, you will see a question mark ?
with a number appended. In Shopify’s servers, Global Asset URL which is kept in as a tool to improve the loading speed of a page.
The way to get global asset
Step 1: Input
Input
{{ 'prototype.js' | global_asset_url | script_tag }}
Step 2: Output
After entering the input, the output will be like that:
Output
<script src="//cdn.shopify.com/s/global/prototype.js?1" type="text/javascript"></script>
The following global assets are available:
{{ 'prototype.js' | global_asset_url | script_tag }}
{{ 'controls.js' | global_asset_url | script_tag }}
{{ 'dragdrop.js' | global_asset_url | script_tag }}
{{ 'effects.js' | global_asset_url | script_tag }}
{{ 'prototype/1.5/prototype.js' | global_asset_url | script_tag }}
{{ 'prototype/1.6/prototype.js' | global_asset_url | script_tag }}
{{ 'scriptaculous/1.8.2/scriptaculous.js' | global_asset_url | script_tag }}
{{ 'scriptaculous/1.8.2/builder.js' | global_asset_url | script_tag }}
{{ 'scriptaculous/1.8.2/controls.js' | global_asset_url | script_tag }}
{{ 'scriptaculous/1.8.2/dragdrop.js' | global_asset_url | script_tag }}
{{ 'scriptaculous/1.8.2/effects.js' | global_asset_url | script_tag }}
{{ 'scriptaculous/1.8.2/slider.js' | global_asset_url | script_tag }}
{{ 'scriptaculous/1.8.2/sound.js' | global_asset_url | script_tag }}
{{ 'scriptaculous/1.8.2/unittest.js' | global_asset_url | script_tag }}
{{ 'ga.js' | global_asset_url | script_tag }}
{{ 'mootools.js' | global_asset_url | script_tag }}
{{ 'lightbox.css' | global_asset_url | stylesheet_tag }}
{{ 'lightbox.js' | global_asset_url | script_tag }}
{{ 'lightbox/v1/lightbox.css' | global_asset_url | stylesheet_tag }}
{{ 'lightbox/v1/lightbox.js' | global_asset_url | script_tag }}
{{ 'lightbox/v2/lightbox.css' | global_asset_url | stylesheet_tag }}
{{ 'lightbox/v2/lightbox.js' | global_asset_url | script_tag }}
{{ 'lightbox/v2/loading.gif' | global_asset_url }}
{{ 'lightbox/v2/close.gif' | global_asset_url }}
{{ 'lightbox/v2/overlay.png' | global_asset_url }}
{{ 'lightbox/v2/zoom-lg.gif' | global_asset_url }}
{{ 'lightbox/v204/lightbox.css' | global_asset_url | stylesheet_tag }}
{{ 'lightbox/v204/lightbox.js' | global_asset_url | script_tag }}
{{ 'lightbox/v204/bullet.gif' | global_asset_url }}
{{ 'lightbox/v204/close.gif' | global_asset_url }}
{{ 'lightbox/v204/closelabel.gif' | global_asset_url }}
{{ 'lightbox/v204/donatebutton.gif' | global_asset_url }}
{{ 'lightbox/v204/downloadicon.gif' | global_asset_url }}
{{ 'lightbox/v204/loading.gif' | global_asset_url }}
{{ 'lightbox/v204/nextlabel.gif' | global_asset_url }}
{{ 'lightbox/v204/prevlabel.gif' | global_asset_url }}
{{ 'list_collection.css' | global_asset_url | stylesheet_tag }}
{{ 'search.css' | global_asset_url | stylesheet_tag }}
{{ 'textile.css' | global_asset_url | stylesheet_tag }}
{{ 'firebug/firebug.css' | global_asset_url | stylesheet_tag }}
{{ 'firebug/firebug.js' | global_asset_url | script_tag }}
{{ 'firebug/firebugx.js' | global_asset_url | script_tag }}
{{ 'firebug/firebug.html' | global_asset_url }}
{{ 'firebug/errorIcon.png' | global_asset_url }}
{{ 'firebug/infoIcon.png' | global_asset_url }}
{{ 'firebug/warningIcon.png' | global_asset_url }}
Conclusion
Getting the Global Asset URL in Shopify is crucial for efficient store management and faster loading times. By using the provided code snippets, you can easily access and implement global assets in your theme. Keep optimizing your store by ensuring these assets are properly integrated to enhance performance and user experience.
In addition, the Shopify store owners can discover more these articles about Liquid URL filters such as: