eZ Systems Website
  Technical documentation
  Editor documentation

This Documentation contains:
Technical documentation:

⚠ WARNING ! This documentation is deprecated !

Please go to the current Technical Documentation

Skip to end of metadata
Go to start of metadata


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 eZ Platform can be used for multisite development, the root location can vary.

By default, the 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. The 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