ez.no / exponential / documentation / reference / template operators / urls / ezurl
$input_string|ezurl()
string containing correct/valid URL.
This operator prepends a string to a URL which by itself would have been invalid. The string that is prepended depends on the siteaccess that is accessed and the environment Exponential is running in. This can be either Virtual Host (VH) or Non Virtual Host (NVH) mode. Please refer to the documentation of the webserver for details about these modes/techniques.
All URLs that are specified in Exponential templates should be piped through the ezurl operator. This will make sure that all URLs work in different setups and in different environments.
Let's say that we're running a site called "my_company" (name of the siteaccess) and that we wish to create a link to the full view of node number 1024. Instead of specifying the entire URL (domain and all included) in the link tag, we simply pipe "/content/view/full/1024" or it's URL alias (in this case "/test") through the ezurl operator:
<a href={"/content/view/full/1024"|ezurl}>Test</a> <a href={"/test"|ezurl}>Test</a>
The operator will take care of translating the strings into a valid URLs depending on the setup and the environment Exponential is running in:
Virtual host environment:
http://www.example.com/content/view/full/1024
http://www.example.com/test
No virtual host, plain/basic environment:
http://www.example.com/index.php/my_company/content/view/full/1024
http://www.example.com/index.php/my_company/test
Comments