eZ Publish 5.1+ comes with a Twig helper as a global variable named ezpublish
.
...
Reference
Property | Description |
---|---|
ezpublish.siteaccess | Returns the current siteaccess. |
ezpublish.rootLocation | Returns the root Location object |
ezpublish.requestedUriString | Returns the requested URI string (also known as semanticPathInfo). |
ezpublish.systemUriString | Returns 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.viewParameters | Returns the view parameters as a hash. |
ezpublish.viewParametersString | Returns the view parameters as a string. |
ezpublish. siteNamelegacy | Returns the name of the current siteaccesslegacy information. |
ezpublish.translationSiteAccess | Returns the translation SiteAccess for a given language, or null if it cannot be found. |
ezpublish.availableLanguages | Returns the list of available languages. |
ezpublish. legacyconfigResolver | Returns legacy informationthe config resolver. |
Legacy
Note |
---|
|
The ezpublish.legacy
property returns an object of type ParameterBag, which is a container for key/value pairs, and contains additional properties to retrieve/handle legacy information.
Property | Description | ||
---|---|---|---|
ezpublish.legacy.all | Returns all the parameters, with all the contained information. | ||
ezpublish.legacy.keys | Returns the parameter keys only. | ||
ezpublish.legacy. replace | Replaces the current parameters by a new set. | ||
ezpublish.legacy.add | Adds parameters. | ||
ezpublish.legacy.get | Returns a parameter by name. | ||
ezpublish.legacy. set | Sets a parameter by name. | ezpublish.legacy.has | Returns true if the parameter is defined. |
ezpublish.legacy.remove | Removes a parameter. | ||
ezpublish.legacy.getAlpha | Returns the alphabetic characters of the parameter value. | ||
ezpublish.legacy.getAlnum | Returns the alphabetic characters and digits of the parameter value. | ||
ezpublish.legacy.getDigits | Returns the digits of the parameter value. | ||
ezpublish.legacy.getInt | Returns the parameter value converted to integer. |
Listing the available parameters
...
Code Block | ||
---|---|---|
| ||
{{ dump(ezpublish.legacy.keys()) }} |
which will returngive a result similar to:
No Format |
---|
array 0 => string 'view_parameters' (length=15) 1 => string 'path' (length=4) 2 => string 'title_path' (length=10) 3 => string 'section_id' (length=10) 4 => string 'node_id' (length=7) 5 => string 'navigation_part' (length=15) 6 => string 'content_info' (length=12) 7 => string 'template_list' (length=13) 8 => string 'cache_ttl' (length=9) 9 => string 'is_default_navigation_part' (length=26) 10 => string 'css_files' (length=9) 11 => string 'js_files' (length=8) 12 => string 'css_files_configured' (length=20) 13 => string 'js_files_configured' (length=19) |
...