stk:html.process-url(function)

This function is used to process native resource URLs in your content, and outputs fully functional URLs.

xs:string?stk:html.process-url
  1. xs:stringurl

Examples

Input

<a href="{stk:html.process-url('page://109')}">page</a>

Result

<a href="https://enonic.com/stk/template-reference">page</a>

Anchors are supported by appending the anchor at the very end.

Input

<a href="{stk:html.process-url('page://109#anchor')}">page with anchor</a>

Result

<a href="https://enonic.com/stk/template-reference#anchor">page with anchor</a>

QueryStrings are also supported, as long as they are added in key=value pair separated with "&amp;" between each pair.

Input

<a href="{stk:html.process-url('page://109?menu=true')}">page with querystring</a>

Result

<a href="https://enonic.com/stk/template-reference?menu=true">page with querystring</a>

You could even combine QueryString and Anchors like this. Important to always add the anchor last, ref. "RFC 3986" standard. And you may never use more than one anchor.

Input

<a href="{stk:html.process-url('page://109?menu=true#anchor')}">page with querystring and anchor</a>

Result

<a href="https://enonic.com/stk/template-reference?menu=true#anchor">page with querystring and anchor</a>

Parameters

url
The URL to process. Can be either page://XXX, content://XXX or attachment://XXX
Type
xs:string