Feature #42614
closed
condition for treeLevel does not support comparisons other than equal
Added by Stefan Neufeind about 12 years ago.
Updated about 6 years ago.
Description
The treeLevel-condition only supports equal-check against one or more values
Not working:
[treeLevel > 0]
Workaround:
[treeLevel = 1,2,3,4,5]
Also not working:
[treeLevel < 3]
[treeLevel != 1]
t3lib/matchcondition/class.t3lib_matchcondition_frontend.php in evaluateCondition()
There some fields are just checked against one or more values. However no "larger" or something the like is supported.
One possible solution that that might be easy to implement would be something like:
[treeLevel = >0]
Multiple values are checked with "or" so it would then be possible to check if for example "below 2 or above 5":
[treeLevel = <2,>5]
Workaround for unequals: [PIDinRootline != 7]
is to negate it:
[PIDinRootline = 7]
[else]
...
[global]
- Tracker changed from Bug to Feature
- Target version set to 6.1.0
This is the documented behaviour so doesn't qualify as a bug and can't be changed before version 6.1.
- Target version changed from 6.1.0 to 7.2 (Frontend)
- Target version changed from 7.2 (Frontend) to 7.4 (Backend)
- Target version changed from 7.4 (Backend) to 7.5
- Target version deleted (
7.5)
- Assignee set to Benni Mack
- Status changed from New to Closed
We've implemented a new TypoScript condition in v9 LTS based on ExpressionLanguage, which now allows for handling treeLevel properly. [tree.level > 2] should do the trick now.
Also available in: Atom
PDF