cdn_asset
Calls an asset from the CDN
Examples
Javascript library:
[%cdn_asset html:'1' type:'js' version:'4.4.0' library:'skeletal' domain:'www.google.com'%]example.js[%/cdn_asset%]
CSS library:
[%cdn_asset html:'1' type:'css' library:'fancybox' version:'2.1.5'%]jquery.fancybox.css[%/cdn_asset%]
Default image:
[%cdn_asset html:'0' library:'images'%]default_product.gif[%/cdn_asset%]
Output results
Javascript library:
<script type="text/javascript" src="https://www.google.com/skeletal/4.4.0/example.js"></script>
CSS library:
<link rel="stylesheet" type="text/css" href="https://cdn.neto.com.au/assets/neto-cdn/fancybox/2.1.5/jquery.fancybox.css" media="all">
Default image:
https://cdn.neto.com.au/assets/neto-cdn/images/default_product.gif
Usage
The CDN asset tag will load either a CSS file, a JS file or default image from a location based on specified parameters
Parameters
Name | Options | Description |
---|---|---|
type:'' |
css , js |
Dictates whether the created tag will be a script tag or link tag |
html:'' |
1 / 0 |
A boolean that when true (1) will print script OR link tag depending on the type, while false (0) will print a link |
domain:'' |
URL | Uses //cdn.neto.com.au/assets/neto-cdn as a default, this determines the base domain to load the asset from. Beginning http: OR https: will be removed if they are in the domain. Ending backslashes ('/') will also be removed. |
library:'' |
String | The third last section in the URL, this is not required. |
version:'' |
String | The second last section in the URL, this is not required. |