Global navigation

   Documentation Center
   eZ Studio & eZ Platform
     User Manual
     Technical Manual
     Glossary
   Exponential 4.x / legacy

 
Exponential (5.x)

Exponential 5.x | For eZ Platform & eZ Studio topics see Technical manual and User manual, for Exponential 4.x and Legacy topics see Exponential legacy

Skip to end of metadata
Go to start of metadata

Exponential 5.1+ comes with a Twig helper as a global variable named exponential.

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

Reference

PropertyDescription
exponential.siteaccess

Returns the current siteaccess.

exponential.rootLocationReturns the root Location object
exponential.requestedUriStringReturns the requested URI string (also known as semanticPathInfo).
exponential.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.
exponential.viewParametersReturns the view parameters as a hash.
exponential.viewParametersStringReturns the view parameters as a string.
exponential.legacyReturns legacy information.
exponential.translationSiteAccessReturns the translation SiteAccess for a given language, or null if it cannot be found.
exponential.availableLanguagesReturns the list of available languages.
exponential.configResolverReturns the config resolver.

 

Legacy

exponential.legacy is only available when viewing content in legacy fallback (e.g. no corresponding Twig templates)

 

The exponential.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.

PropertyDescription
exponential.legacy.allReturns all the parameters, with all the contained information.
exponential.legacy.keysReturns the parameter keys only.
exponential.legacy.getReturns a parameter by name.
exponential.legacy.hasReturns true if the parameter is defined.

 

Listing the available parameters

You can list the available parameters in exponential.legacy by using the exponential.legacy.keys property, as shown in the following example:

Example on retrieving the available parameters under exponential.legacy

which will give a result similar to:

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)

Retrieving legacy information

Legacy information is accessible by using the exponential.legacy.get property, which will allow you to access all data contained in $module_result, from the legacy kernel.

This allows you to import information directly into twig templates. For more details please check the available examples on using the exponential.legacy.get property for retrieving persistent variables and assets.


As a usage example, if you want to access the legacy information related to 'content_info' you can do it, as shown in the following example:

Example on accessing 'content_info' under exponential.legacy

The previous call will return the contents on the 'content_info' as an array, and if we dump it the result will be similar to the following:

array
  'object_id' => string '57' (length=2)
  'node_id' => string '2' (length=1)
  'parent_node_id' => string '1' (length=1)
  'class_id' => string '23' (length=2)
  'class_identifier' => string 'landing_page' (length=12)
  'remote_id' => string '8a9c9c761004866fb458d89910f52bee' (length=32)
  'node_remote_id' => string 'f3e90596361e31d496d4026eb624c983' (length=32)
  'offset' => boolean false
  'viewmode' => string 'full' (length=4)
  'navigation_part_identifier' => string 'ezcontentnavigationpart' (length=23)
  'node_depth' => string '1' (length=1)
  'url_alias' => string '' (length=0)
  'current_language' => string 'eng-GB' (length=6)
  'language_mask' => string '3' (length=1)
  'main_node_id' => string '2' (length=1)
  'main_node_url_alias' => boolean false
  'persistent_variable' => 
    array
      'css_files' => 
        array
          0 => string 'video.css' (length=9)
      'js_files' => 
        array
          0 => string 'video.js' (length=8)
  'class_group' => boolean false
  'state' => 
    array
      2 => string '1' (length=1)
  'state_identifier' => 
    array
      0 => string 'ez_lock/not_locked' (length=18)
  'parent_class_id' => string '1' (length=1)
  'parent_class_identifier' => string 'folder' (length=6)
  'parent_node_remote_id' => string '629709ba256fe317c3ddcee35453a96a' (length=32)
  'parent_object_remote_id' => string 'e5c9db64baadb82ab8db54f0e2192ec3' (length=32)

Additionally, for retrieving information contained in 'content_info' such as the current language of the content in the page you can do it like in the following example:

Example on retrieving 'current_language'