From e11eece3a64cd053b0f0eed72a9510d216f31734 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Thu, 14 Nov 2024 09:38:54 +0100 Subject: [PATCH] [TASK] Mention tree.level starting at 1 not 0 As mentioned in https://forge.typo3.org/issues/96385 the former treeLevel started at `0` but with the change to `tree.level` this was changed to be based at `1` for root level. The docs need to reflect this fact. --- Documentation/UsingSetting/Conditions.rst | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Documentation/UsingSetting/Conditions.rst b/Documentation/UsingSetting/Conditions.rst index f6b2d73..2779df8 100644 --- a/Documentation/UsingSetting/Conditions.rst +++ b/Documentation/UsingSetting/Conditions.rst @@ -150,21 +150,28 @@ tree.level :type: integer Current tree level. Only available in page TSconfig, not - in user TSconfig. + in user TSconfig. Starts at `1` (root level). .. _condition-tree-level-example: -Example: Condition applies on a page with level 0 -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Example: Condition applies on a page on root level +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: typoscript :caption: EXT:site_package/Configuration/page.tsconfig - # Check if page is on level 0: - [tree.level == 0] + # Check if page is on level 1 (root): + [tree.level == 1] // Your settings go here [END] + .. hint:: + + In older versions before TYPO3 v10, this setting was available as + `treeLevel` variable. + That variable started the root level at value `0`, and now it starts at `1`. + Keep this in mind when migrating old conditions. + .. index:: Conditions; tree.pagelayout .. _condition-tree-pagelayout: