[TYPO3-english] TCA - multiple displayCond

Andreas Kalkhoff AndreasKalki at gmx.de
Wed Feb 20 12:09:46 CET 2013

Hi everyone,

as I recently learned that it is impossible to set multiple displayCond's for the backend I decided to make it work somehow, as I didn't want to wait until Typo3 6.1 to be able to insert arrays as displayCond.

Furthermore, I dislike patching the core itself, thus I kept searching for a workaround. In the end I came to solve the issue without hooks/xclass:

As the displayCond's work with POST, I used 

	$post_array = t3lib_div::_GP('data');

to access the POST-data that was transmitted.
Now I merely had to access the specific fields in that array and build custom conditionals based on those, e.g.:

	if ($post_array== "1") {
		$tempColumns= 'FIELD:tx_myext_field_3:=:0';
	else {
		$tempColumns=  'FIELD:tx_myext_field_1:=:1';

Up to this point, everything is working just fine - except the case when I open the datarecord initially while tx_myext_field_1 is 1 AND FIELD:tx_myext_field_3 is 0, as the initial opening of the datarecord does not use POST.

Does anyone know how I can access the current values within the TCA while opening the datarecord initially?
Furthermore I'd like to hear your opinions about my workaround, whether or not I may do it in a more efficient/appropriate way.


More information about the TYPO3-english mailing list