Message-ID: <204881791.3994.1485856234883.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_3993_229149644.1485856234883" ------=_Part_3993_229149644.1485856234883 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
ez_urlalias
is a not a real Twig helper, but a special route name for generating URLs for a location, from the given parameters.
path( eZ\Publish\API\Repository\Values\Conte=
nt\Location|string name[, array parameters][, bool absolute] )
Argument name | Type | Description |
---|---|---|
name | string | \eZ\Publish\API\Repo=
sitory\Values\Content\Location |
The name of the route or a Lo= cation instance |
parameters | array | An hash of parameters:
|
absolute | boolean | Whether to generate an absolu= te URL |
Linking to other locations is fairly easy and is done with native path()
Twig helper=
a> (or url()
if you want to generate absolute URLs). You just =
have to pass it the Location object and path()
will generate t=
he URLAlias for you.
{# Assuming "location" variable is a valid eZ\Publish\API\Repositor= y\Values\Content\Location object #} <a href=3D"{{ path( location ) }}">Some link to a location</a>=20
<a href=3D"{{ path( "ez_urlalias", {"locationId": 123} ) }}">= Some link to a location, with its Id only</a>=20
Link generation from contentId is available as of 5.4 / 2014.11.
<a href=3D"{{ path( "ez_urlalias", {"contentId": 456} ) }}">S= ome link from a contentId</a>=20
Important: Links generated from a Content ID will point to it= s main location.
For Location alias setup 301 redirect to Location's current URL when:
Under the hood