global_asset_url
Table of contents
Returns the url of a ‘global asset’. Global assets are commonly used assets. By using these url’s as input for a script_tag
or stylesheet_tag
you don’t have to upload them yourself. Usually the url’s are of the recommended CDN’s.
The filter accepts two possible arguments: asset type (css/js) and version (default value depending on asset).
{{ "bootstrap" | global_asset_url | stylesheet_tag }}
{{ "bootstrap" | global_asset_url: "js", "4.0.0-beta" | script_tag }}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>
The following global assets are available:
"bootstrap" # Default version: 3.3.7. Available types: css, js.
"font_awesome" # Default version: 4.7.0. Available types: css.
global_asset_url
for FontAwesome only works for version 4.7.0 and lower.
"jquery" # Default version: 3.2.1. Available types: js.
"lightbox" # Default version: 2.10.0. Available types: css, js.
"animate" # Default version: 3.5.2. Available types: css.
"cycle2" # Default version: n/a. Available types: js.