Feature #17299

Enable/integrate conditions in Page TSconfig

Added by Oliver Hader over 12 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2007-05-11
Due date:
% Done:

0%

PHP Version:
4.3
Tags:
Complexity:
Sprint Focus:

Description

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:
[PIDupinRootline=1]
mod.SHARED.colPos_list=0
[end]

(issue imported from #M5613)

0005613_v8.patch View (9.3 KB) Administrator Admin, 2007-07-25 16:30

tsconfig_cond_2007-11-20.diff View (26.1 KB) Administrator Admin, 2007-11-20 13:57

5613_tsconfig_cond_2008-04-21.diff View (25.5 KB) Administrator Admin, 2008-04-21 18:11

5613_tsconfig_conditions_20090321.patch View (22.6 KB) Administrator Admin, 2009-03-21 00:59

0005613_v13.patch View (56.6 KB) Administrator Admin, 2009-07-21 20:53

0005613_v15.patch View (67.9 KB) Administrator Admin, 2009-10-06 19:05

0005613_v16.patch View (99.3 KB) Administrator Admin, 2009-10-19 23:00

0005613_v17.patch View (99 KB) Administrator Admin, 2009-10-20 16:39

0005613_v18.patch View (50.9 KB) Administrator Admin, 2009-10-20 18:03

0005613_tests_v18.patch View (46 KB) Administrator Admin, 2009-10-20 18:03

0005613_v19.patch View (50.9 KB) Administrator Admin, 2009-10-20 19:18

0005613_tests_v19.patch View (47.6 KB) Administrator Admin, 2009-10-20 19:30


Related issues

Related to TYPO3 Core - Bug #19601: t3lib_div::trimExplode limit parameter leads to wrong result with non-empty requirement Closed 2008-11-12
Related to TYPO3 Core - Bug #21309: Move t3lib_matchCondition::whichDevice() to t3lib_utility_Client::getDeviceType() Closed 2009-10-19
Related to TYPO3 Core - Feature #18749: TSConfig per content (tt_content) is needed in addition to the actual Page TSConfig Closed 2008-05-05

History

#1 Updated by Oliver Hader over 12 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.

#2 Updated by Oliver Hader over 12 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.

#3 Updated by Oliver Hader over 12 years ago

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

#4 Updated by Oliver Hader over 12 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

#5 Updated by Oliver Hader over 12 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)

#6 Updated by Oliver Hader over 12 years ago

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

#7 Updated by Benni Mack almost 12 years ago

This patch is not in the core yet!

#8 Updated by Benni Mack almost 12 years ago

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

#9 Updated by Oliver Hader almost 12 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)

#10 Updated by Helmut Hummel over 11 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

#11 Updated by Oliver Hader over 10 years ago

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

#12 Updated by Benni Mack over 10 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?

#13 Updated by Oliver Hader over 10 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...

#14 Updated by Oliver Hader about 10 years ago

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

#15 Updated by Oliver Hader about 10 years ago

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

Also available in: Atom PDF