stk:file.create-resource-url(function)

Generates a public resource URL to a theme or STK resource (files located in public theme or STK folder). File type folder is automatically set from filetype. The static resources must be put in folders named "img" (images), "css" and "js" (javascript). Use {theme}, {stk} and {shared} to specify resource folder ({theme} is used by default).

  1. xs:stringfile-path

Examples

Input

<xsl:value-of select="stk:file.create-resource-url('testimage.jpg')"/>

Result

https://enonic.com/stk/_public/theme-doc/img/testimage.jpg

Input

<xsl:value-of select="stk:file.create-resource-url('{stk}/stk.js')"/>

Result

https://enonic.com/stk/_public/library-stk/js/stk.js?_ts=14376ece040

Input

<xsl:value-of select="stk:file.create-resource-url('{shared}/jquery.js')"/>

Result

https://enonic.com/stk/_public/shared/js/jquery.js

Parameters

file-path
The file path of the public resource
Type
xs:string