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.

{{ theme:asset src="img/hat.jpg" }}
/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.

{{ theme:img src="hat.jpg" }}
/site/themes/redwood/img/hat.jpg

Parameters

type

tag part

You can optionally swap out the asset tag part for the asset type you wish. For example, {{ theme:svg }}

src

string

The path to the file, relative to the theme directory.

cache_bust

boolean false

Setting this to true will add the timestamp of the asset to the end of the URL in a ?v= query param.

absolute

boolean false

Render the URL in an absolute format.

Last modified on August 22, 2017