Feature #17299


Enable/integrate conditions in Page TSconfig

Added by Oliver Hader about 17 years ago. Updated almost 14 years ago.

Should have
Target version:
Start date:
Due date:
% Done:


Estimated time:
PHP Version:
Sprint Focus:


doc_core_tsconfig tells us "The syntax is as usual TypoScript, only difference is that you cannot use any Constants or Conditions."

In some situations conditions make also sense for the TYPO3 page. Imagine you'd like to set TSconfig for sub-pages of the current one. There is currently no "next Level" functionality in the backend like it is in templates for the frontend.

t3lib_matchcondition has to be extended to work also in backend - maybe some conditions cannot be ported from frontend to backend at all.

Imagine the following page strucutre:
1 |-- 2 |-- 3

With the following Page TSconfig, only the pages 2 and 3 are affected:

(issue imported from #M5613)


0005613_v8.patch (9.3 KB) 0005613_v8.patch Administrator Admin, 2007-07-25 16:30
tsconfig_cond_2007-11-20.diff (26.1 KB) tsconfig_cond_2007-11-20.diff Administrator Admin, 2007-11-20 13:57
5613_tsconfig_cond_2008-04-21.diff (25.5 KB) 5613_tsconfig_cond_2008-04-21.diff Administrator Admin, 2008-04-21 18:11
5613_tsconfig_conditions_20090321.patch (22.6 KB) 5613_tsconfig_conditions_20090321.patch Administrator Admin, 2009-03-21 00:59
0005613_v13.patch (56.6 KB) 0005613_v13.patch Administrator Admin, 2009-07-21 20:53
0005613_v15.patch (67.9 KB) 0005613_v15.patch Administrator Admin, 2009-10-06 19:05
0005613_v16.patch (99.3 KB) 0005613_v16.patch Administrator Admin, 2009-10-19 23:00
0005613_v17.patch (99 KB) 0005613_v17.patch Administrator Admin, 2009-10-20 16:39
0005613_v18.patch (50.9 KB) 0005613_v18.patch Administrator Admin, 2009-10-20 18:03
0005613_tests_v18.patch (46 KB) 0005613_tests_v18.patch Administrator Admin, 2009-10-20 18:03
0005613_v19.patch (50.9 KB) 0005613_v19.patch Administrator Admin, 2009-10-20 19:18
0005613_tests_v19.patch (47.6 KB) 0005613_tests_v19.patch Administrator Admin, 2009-10-20 19:30

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #19601: t3lib_div::trimExplode limit parameter leads to wrong result with non-empty requirementClosedOliver Hader2008-11-12

Related to TYPO3 Core - Bug #21309: Move t3lib_matchCondition::whichDevice() to t3lib_utility_Client::getDeviceType()ClosedOliver Hader2009-10-19

Related to TYPO3 Core - Feature #18749: TSConfig per content (tt_content) is needed in addition to the actual Page TSConfigClosed2008-05-05

Actions #1

Updated by Oliver Hader about 17 years ago

userFunc is currently disabled in BE
This could be extended to use t3lib_div::callUserFunction (also for FE) - thus it's not required anymore (but allowed) to have the user function globally.

Actions #2

Updated by Oliver Hader about 17 years ago

userFunc was enabled again, but not with t3lib_div::callUserFunction - there are some more changes needed (if it makes sense at all) and would go to a new feature request.

Actions #3

Updated by Oliver Hader about 17 years ago

I had a bug in t3lib_matchCondition::getPageId and fixed it with the new file 0005613_v4.patch.

Actions #4

Updated by Oliver Hader almost 17 years ago

Integrated to fixes:
  • PIDupinRootline didn't work when creating a new page and the parent page was the one set in PIDupinRootline
  • disabled caching of TSconfig if conditions were found
Actions #5

Updated by Oliver Hader almost 17 years ago

Integrated one fix:
  • on saving a new page record during the TCEmain phase the PIDupinRootline was processed wrong if the parent page of the new one was set there (thanks to Carsten Lausen for pointing this out)
Actions #6

Updated by Oliver Hader almost 17 years ago

Integrated one fix:
  • if a new page is created after another one (uid negative, e.g. "-333") this wasn't resolved correctly
Actions #7

Updated by Benni Mack over 16 years ago

This patch is not in the core yet!

Actions #8

Updated by Benni Mack over 16 years ago

Somebody needs to submit it to the core list, I haven't seen it in my latest trunk.

Actions #9

Updated by Oliver Hader over 16 years ago

Oh, it is already in the Core List. Bernhard just used a misleading subject:
"RFC: Hook request for t3lib_befunc + t3lib_userauthgroup" (2007-11-16)

Actions #10

Updated by Helmut Hummel about 16 years ago

I added a patch agains current revison 3600 (4_2 branch)

It works for my so far, but I could not resolv the remaining issues Olly mentioned in core List:

1) t3lib_TSparser_TSconfig
Why are you looking for $TSFE->sys_page? The hash-string stays the same
if deliverd to t3lib_pageSelect ($TSFE->sys_page) or to t3lib_BEfunc.
IMO we could replace the stuff in t3lib_TSparser_TSconfig::getHash() by:
if (TYPO3_MODE=='BE' || isset($GLOBALS['TSFE']) &&
is_object($GLOBALS['TSFE']) && $GLOBALS['TSFE']->beUserLogin) {
return t3lib_BEfunc::getHash($hash, $expTime);
Can't we?

2) We have to encapsulate the new functions (private, protected, ...)

3) In t3lib_matchCondition::evalPageId() I found a bug:
'new': the id delivered might be negative (new record after existing)

In t3lib_matchCondition::evalConditionStr(), case 'treeLevel':
This should be extended for the case a new page is generated which would
increment the treeLevel by 1.

Perhaps someone can do this and update the patch. This will be a great feature for 4.3

Actions #11

Updated by Oliver Hader about 15 years ago

Benni, thanks for adding an updated version of the patch! :)

Actions #12

Updated by Benni Mack about 15 years ago

Sure, however, I don't like adding this new "hybrid" class. I would much rather have a new class named "t3lib_febefunc" class that includes a lot of common functions used for FE and BE, "hybrid" just doesn't tell what's in the class. "febefunc" I don't like so much either, better ideas?

Actions #13

Updated by Oliver Hader almost 15 years ago

Attached a "work-in-progress" version as v13 - it's not finished...

Split up matchCondition to a backend and frontend class.
Updated patch to apply with Trunk again.

More to come...

Actions #14

Updated by Oliver Hader over 14 years ago

v16 requires
  • integration of follow-up for #19601
  • integration of refactoring #19601
Actions #15

Updated by Oliver Hader over 14 years ago

Committed to SVN Trunk (rev. 6188)
Committed tests to SVN Trunk (rev. 6189)


Also available in: Atom PDF