[FEATURE] Add AbstractCondition for TS conditions
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Documentation / Changelog / master / Feature-61489-AbstractTypoScriptCondition.rst
1 ================================================================
2 Feature: #61489 - Allow own TypoScript Condition implementations
3 ================================================================
4
5 Description
6 ===========
7
8 It is now possible to add own TypoScript conditions via a
9 separate API.
10
11 An extension / package can now ship an implementation of a new
12 abstract class AbstractCondition. Via the existing TypoScript
13 Condition Syntax the class is called by the simple full namespaced
14 class name.
15 The class's main function "matchCondition" can flexibly evaluate
16 any parameters given after the class name.
17
18 Usage:
19
20 .. code-block:: typoscript
21
22 [BigCompanyName\TypoScriptLovePackage\BennisTypoScriptCondition]
23
24 [BigCompanyName\TypoScriptLovePackage\BennisTypoScriptCondition = 7]
25
26 [BigCompanyName\TypoScriptLovePackage\BennisTypoScriptCondition = 7, != 6]
27
28 [BigCompanyName\TypoScriptLovePackage\BennisTypoScriptCondition = {$mysite.myconstant}]
29
30 where the TypoScript Condition class deals with =/!= etc itself.
31
32 Impact
33 ======
34
35 If you've previously used the "userFunc" condition, it is encouraged
36 to use this new API for your own TypoScript conditions.