Retrieving root Location¶
The root Location can be a starting point for API queries, or even links to home page.
By default, the root Location ID is 2
, but the best practice is to retrieve it dynamically.
This is because eZ Platform can be used for multisite development,
and the root Location can vary. The Location can also be changed by configuration.
Retrieving root Location ID¶
Root location ID can be retrieved from ConfigResolver.
The parameter name is content.tree_root.location_id
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Retrieving the root Location¶
From template¶
Root Location is exposed in the global Twig helper.
1 |
|
From controller¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|