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

[TASK] Mention tree.level starting at 1 not 0 #564

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading