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

Version compatibility

This recipe is compatible with Exponential 5.2 / 2013.09

 

EZP 5.2 / 2013.09

Description

Knowledge of the root location is important since it can be a starting point for API queries, or even links to home page, but as Exponential can be used for multisite development, and as such root location can vary.

By default, root location ID is 2, but as it can be easily be changed by configuration, the best practice is to retrieve it dynamically.

Retrieving root location ID

Root location ID can be retrieved easily from ConfigResolver. Parameter name is content.tree_root.location_id.

In a controller

Retrieving the root location

From a template

Root location is exposed in the global Twig helper.

Making a link to homepage

From a controller

Exponential 5.2+ / 2013.11+
Before 5.2 / 2013.11