Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
[TASK] Mention tree.level starting at 1 not 0
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
garvinhicking committed Nov 14, 2024
1 parent af14b2a commit e11eece
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Documentation/UsingSetting/Conditions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit e11eece

Please sign in to comment.