Asset
Get the URL to a file in your theme.
Explicit mode
Using {{ theme:asset }}
requires that you enter the complete path to the asset in the src
parameter.
Template
{{ theme:asset src="img/hat.jpg" }}
Output
/site/themes/redwood/img/hat.jpg
Shorthand mode
You can swap out the asset
tag part for the initial directory to make your templates a little more readable.
Here we’re using {{ theme:img }}
to go directly into the img
subfolder.
Template
{{ theme:img src="hat.jpg" }}
Output
/site/themes/redwood/img/hat.jpg
Parameters
type tag part | You can optionally swap out the |
---|---|
src string | The path to the file, relative to the theme directory. |
cache_bust boolean false | Setting this to |
absolute boolean false | Render the URL in an absolute format. |