Feature #29168

Enable constants in conditions in TypoScript templates

Added by Simon Schaufelberger over 8 years ago. Updated almost 5 years ago.

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

0%

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.

History

#1 Updated by Chris topher over 8 years ago

  • Subject changed from conditions with constants to Enable constants in conditions in TypoScript templates
  • Target version set to 4.7.0

#2 Updated by Steffen Gebert over 8 years ago

Simon, couldn't we call getVariable() before the case? Would this not work? If it should, please provide a patch after branching 4.6 (either after an RC or after final release)

#3 Updated by Simon Schaufelberger over 8 years ago

I am sure this would also work but i have not tested it. It was just to show the basic idea how this problem could be solved.

#4 Updated by Gerrit Code Review almost 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7729

#5 Updated by Gerrit Code Review almost 8 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7729

#6 Updated by Gerrit Code Review almost 8 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/7729

#7 Updated by Steffen Ritter almost 8 years ago

  • Target version deleted (4.7.0)

#8 Updated by Gerrit Code Review almost 6 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/7729

#9 Updated by Wouter Wolters almost 5 years ago

  • Status changed from Under Review to Closed

Works already without patch.

Also available in: Atom PDF