[TYPO3-dev] TCA, wsitch the look of a field but using the same field name

Ries van Twisk typo3 at rvt.dds.nl
Sat Jun 3 15:00:06 CEST 2006


Hi Jochen,

I don't use flexform but willing to change... however the kickstarter 
made this nice code for me already :)
I tried using displayCond, however seens the look change and the 
fieldname stays the same.
The total configuration is getting overwritten by the last one.

Currently I solved it like this:
if (isset($_REQUEST['edit']['tx_rvtintellipops_items'])) {
    $UID = key($_GET['edit']['tx_rvtintellipops_items']);
   
    if ($_REQUEST['data']['tx_rvtintellipops_items']) {
        $popuptype = 
$_REQUEST['data']['tx_rvtintellipops_items'][$UID]['popuptype'];
    } else {
        $res = $GLOBALS['TYPO3_DB'] -> exec_SELECTquery('popuptype', 
'tx_rvtintellipops_items', 'uid='.$UID);
        $row = $GLOBALS['TYPO3_DB'] -> sql_fetch_assoc($res);
        $popuptype = $row['popuptype'];
    }
    switch ($popuptype) {
        case 0:
        case 1:
        case 3:
            
$TCA["tx_rvtintellipops_items"]['columns']['content']['config'] = 
$configRTE ;
        break;
        case 2:
            
$TCA["tx_rvtintellipops_items"]['columns']['content']['config'] = 
$configColorPicker;
        break;
    }
}


I know it's a ugly duck.. but it was the best I could come up with under 
a short notice.
Also I couldn't find any other example or method, looked in the 
documentation a lot also.
It not a problem to show or hide fields based on conditions.
But it is a problem using the same field with different forms. I 
possible have missed something...

I don't want to bloat my record with many many fields I hardly use and 
like to re-use the field content
under different conditions.

I will look into dynaflex and see if that can work with the TCA, if yes 
how and in such a way
that I don't spend many hours converting my $TCA to dynaflex...

Ries


>Hi Ries,
>
>  
>
>>How can I detect what radio is selected and to replace the config in 
>>content based on the above radio?
>>    
>>
>
>displayCond might be your friend. This should work in normal TCA config 
>[1] as well as in Flexforms [2]. Beside that there is the extension 
>dynaflex [3] in case you are using flexforms.
>
>Regards,
>Jochen
>
>[1]
>http://typo3.org/documentation/document-library/core-documentation/doc_core_api/current/view/4/2/
>
>[2]
><xyz>
>   <TCEforms>
>     <displayCond>FIELD:yourotherfield:=:YOURVALUE</displayCond>
>     <label>LLL:EXT:yourextension/locallang_tca.php:xyz</label>
>     <config>
>       <type>input</type>
>       <size>5</size>
>     </config>
>   </TCEforms>
></xyz>
>
>[3]
>http://typo3.org/extensions/repository/search/dynaflex/0.2.0/
>_______________________________________________
>TYPO3-dev mailing list
>TYPO3-dev at lists.netfielders.de
>http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
>  
>


-- 
Ries van Twisk
Freelance Typo3 Developer
=== Private:
email: ries at vantwisk.nl
web:   http://www.rvantwisk.nl/freelance-typo3.html
skype: callto://r.vantwisk
=== Work:
email: ries at livetravelguides.com
web:   http://www.livetravelguides.com





More information about the TYPO3-dev mailing list