[TYPO3-english] multiple displayCond in TCA

Georg Schönweger georg.schoenweger at gmail.com
Tue Feb 22 09:55:55 CET 2011


Hi Stefan,

thx for your efforts! where is
"t3lib_contextmenu_abstractdataprovider.php" located? Can't find it in
T3 4.5.
Sry but i don't understand .. Is this your code or is it already in Typo3?

----
    // parse condition string
    $conditions = array();
    preg_match_all('/(.+?)(>=|<=|!=|=|>|<)(.+?)(\|\||&&|$)/is',
$displayCondition, $conditions);

    $lastResult = FALSE;
    $chainType = '';
    $amountOfConditions = count($conditions[0]);
    for ($i = 0; $i < $amountOfConditions; ++$i) {
----

Are feature requests for T3 Core made via bugs.typo3.org?

- Georg

Am 22.02.2011 09:25, schrieb Stefan Frömken:
> Am 17.02.2011 15:25, schrieb Georg Schönweger:
>> Hi,
>>
>> is it possible to set multiple displayCond in TCA? I would like to have:
>> 'displayCond' =>  'FIELD:some_field:REQ:false', AND 'displayCond' =>
>> 'FIELD:some_other_field:REQ:true',
>>
>> I found also another thread about multiple displayCond in FlexForms, but
>> the thread is 2 years old so maybe now it is possible? ;
>> http://www.justinml.com/mailing-lists/cms-typo3/typo3-dev-mailing-list/subject/mailing/typo3-dev-flexform-more-displaycond/
>>
>>
>> - Georg
>>
>>
>
> Let's have a look into Core 4.4.2 file class.t3lib_tceforms.php:
>
> ---------------------
> function isDisplayCondition($displayCond,$row,$ffValueKey='')    {
>     $output = FALSE;
>     $parts = explode(':',$displayCond);
> ---------------------
>
> You see...there is no possibility to add multiple conditions
>
> Let's have a look into Core 4.5.0:
>
> ---------------------
> function isDisplayCondition($displayCond, $row, $ffValueKey = '') {
>     $output = FALSE;
>     $parts = explode(':', $displayCond);
> ---------------------
>
> The conditionstring will be divided by colon directly. So..there is no
> multiple condition, too.
>
> But I found something in t3lib_contextmenu_abstractdataprovider.php:
>
> ---------------------
> protected function evaluateDisplayCondition(t3lib_tree_Node $node,
> $displayCondition) {
>     if ($displayCondition === '') {
>         return TRUE;
>     }
>
>     // parse condition string
>     $conditions = array();
>     preg_match_all('/(.+?)(>=|<=|!=|=|>|<)(.+?)(\|\||&&|$)/is',
> $displayCondition, $conditions);
>
>     $lastResult = FALSE;
>     $chainType = '';
>     $amountOfConditions = count($conditions[0]);
>     for ($i = 0; $i < $amountOfConditions; ++$i) {
> ---------------------
>
> Maybe this is an idea, to implement multiple conditions in TCEforms,
> too. Try to create a feature request.
>
> Stefan
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english


More information about the TYPO3-english mailing list