Feature #29168

Enable constants in conditions in TypoScript templates

Added by Simon Schaufelberger almost 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2011-08-22
Due date:
% Done:

0%

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

Description

Right now, it is not possible to write something like this:

[PIDinRootline = LIT:{$tsconstant}]
# ...
[end]

Changing the check to:

case 'PIDinRootline':
$value = $this->getVariable(trim($value));
$values = t3lib_div::trimExplode(',', $value, TRUE);
if (($key == 'PIDinRootline') || (!in_array($this->pageId, $values))) {
    foreach ($values as $test) {
        foreach ($this->rootline as $rl_dat) {
            if ($rl_dat['uid'] == $test) {
                return TRUE;
            }
        }
    }
}

would solve that problem in t3lib/matchcondition/class.t3lib_matchcondition_frontend.php just for this case. of course this could be changed in other conditions as well.

Also available in: Atom PDF