Project

General

Profile

Actions

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.

Status:
Closed
Priority:
Should have
Assignee:
Category:
TypoScript
Target version:
-
Start date:
2012-11-02
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

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]

Actions #1

Updated by Stefan Neufeind about 12 years ago

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]

Actions #2

Updated by Stefan Neufeind about 12 years ago

Workaround for unequals: [PIDinRootline != 7]
is to negate it:

[PIDinRootline = 7]
[else]
...
[global]

Actions #3

Updated by Thorsten Kahler about 12 years ago

  • 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.

Actions #4

Updated by Mathias Schreiber almost 10 years ago

  • Target version changed from 6.1.0 to 7.2 (Frontend)
Actions #5

Updated by Benni Mack over 9 years ago

  • Target version changed from 7.2 (Frontend) to 7.4 (Backend)
Actions #6

Updated by Susanne Moog over 9 years ago

  • Target version changed from 7.4 (Backend) to 7.5
Actions #7

Updated by Benni Mack about 9 years ago

  • Target version deleted (7.5)
Actions #8

Updated by Riccardo De Contardi over 7 years ago

  • Assignee set to Benni Mack
Actions #9

Updated by Benni Mack about 6 years ago

  • 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.

Actions

Also available in: Atom PDF