Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,075 of 9,075 pages
About the help in other languages
All help pages

URL operators

Building links and asset URLs that work under every siteaccess and installation path: ezurl for site links, ezroot for root paths, ezdesign and ezimage for design files, the quote parameter (double, single, no) and full…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/designers/templates/url-operators.md

On this page

URL operators

This page is for designers who write links. Never write /news/article or /extension/mytheme/... by hand: the site may run under a path prefix, a siteaccess in the URL or a different host. The URL operators of kernel/common/ezurloperator.php build correct URLs.

Contents

  1. The operators
  2. Quotes
  3. Full URLs
  4. Examples
  5. ezsys and exturl

The operators

OperatorForAdds the siteaccess path?
ezurllinks to pages of the site ('/content/search', a node's url_alias)yes
ezrootpaths from the installation root (var/... storage files, image alias URLs)no
ezdesignany file inside a design, found through the cascade ('stylesheets/print.css')no
ezimagea file in a design's images/ folder, found through the cascadeno

Quotes

By default the operators return the URL with double quotes, so you write the attribute without quotes:

<a href={$node.url_alias|ezurl}>...</a>

The first parameter changes that: 'single' for single quotes, 'no' for none:

<a href="{$node.url_alias|ezurl( 'no' )}#comments">...</a>
srcset="{$img.url|ezroot( 'no' )} 480w"

With 'no' you are responsible for the quotes around the attribute.

Full URLs

The second parameter 'full' adds the scheme and host (from eZSys::serverURL()), for canonical links, Open Graph tags and mails:

<link rel="canonical" href={$node.url_alias|ezurl( 'double', 'full' )}>
<meta property="og:url" content={$node.url_alias|ezurl( 'double', 'full' )}>

Examples

<a href={'/'|ezurl}>{'Home'|i18n( 'design/mytheme' )}</a>
<a href={'/user/login'|ezurl}>{'Sign in'|i18n( 'design/mytheme' )}</a>
<form action={'/content/search'|ezurl} method="get">...</form>
<img src={'logo.svg'|ezimage} alt="{$site.title|wash}">
<img src={$node.data_map.image.content['medium'].url|ezroot} alt="...">
<link rel="manifest" href={'images/favicon/site.webmanifest'|ezdesign}>

A link to a node: $node.url_alias|ezurl. A link to a view with parameters: concat( $node.url_alias, '/(offset)/', $offset )|ezurl.

ezsys and exturl

  • ezsys( 'wwwdir' ), ezsys( 'indexdir' ), ezsys( 'indexfile' ), ezsys( 'sitedir' ), ezsys( 'querystring' ) return facts about the installation and request (the attributes eZSys::attributes() lists). Another name is a template warning.
  • exturl registers an external URL in the kernel's URL table (the list of links the administration can check) and returns it. For an ordinary external link, write the URL directly (href="https://...") and wash it if it comes from content.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x