Project

General

Profile

Actions

Feature #29168

closed

Enable constants in conditions in TypoScript templates

Added by Simon Schaufelberger over 13 years ago. Updated almost 10 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.

Actions #1

Updated by Chris topher over 13 years ago

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

Updated by Steffen Gebert about 13 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)

Actions #3

Updated by Simon Schaufelberger about 13 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.

Actions #4

Updated by Gerrit Code Review almost 13 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

Actions #5

Updated by Gerrit Code Review almost 13 years ago

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

Actions #6

Updated by Gerrit Code Review almost 13 years ago

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

Actions #7

Updated by Steffen Ritter over 12 years ago

  • Target version deleted (4.7.0)
Actions #8

Updated by Gerrit Code Review over 10 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

Actions #9

Updated by Wouter Wolters almost 10 years ago

  • Status changed from Under Review to Closed

Works already without patch.

Actions

Also available in: Atom PDF