bitmask_value_field

bitmask_value_field
Path

$GLOBALS['TCA'][$table]['types'][$type]

type

string (field name)

Field name, which holds a value being the integer (bit-mask) for the 'bitmask_excludelist_bits' array.

It works much like 'subtype_value_field' but excludes fields based on whether a bit from the value field is set. See property bitmask_excludelist_bits.

These two properties are rarely used, but pretty powerful if a 'type=radio' or 'type=check' field is set as bitmask_value_field.

[+/-] indicates whether the bit [bit-number] is set or not.

Example

'types' => [
   'aType' => [
      'showitem' => 'aField, anotherField, yetAnotherField',
      'bitmask_value_field' => 'theSubtypeValueField',
      'bitmask_excludelist_bits' => [
         '-1' => 'anotherField', // Remove if bit 1 is NOT set
         '+2' => 'yetAnotherField', // Remove if bit 2 is set
      ],
   ],
],
Copied!

With the above configuration, if field database "theSubtypeValueField" is set to value 5 (binary representation "1 0 1"), the fields "anotherField" (-1 = 0 at bit position 1) and "yetAnotherField" (+2 = 1 at bit position 2) are not displayed, thus leaving only field "aField". If the value is 1 (binary representation "0 0 1"), fields "aField" and "yetAnotherField" are shown, while "anotherField" is not.