eZ Publish 5 comes with a Twig helper as a global variable named ezpublish.

This helper is accessible from all Twig templates and allows you to easily retrieve useful information.

Reference

PropertyDescription
ezpublish.siteaccess

Returns the current siteaccess.

ezpublish.requestedUriStringReturns the requested URI string (also known as semanticPathInfo).
ezpublish.systemUriStringReturns the "system" URI string. System URI is the URI for internal content controller. If current route is not an URLAlias, then the current Pathinfo is returned.
ezpublish.viewParametersReturns the view parameters as a hash.
ezpublish.viewParametersStringReturns the view parameters as a string.
ezpublish.siteNameReturns the name of the current siteaccess.

 

Legacy