In case you need to linked/required/folded the Fields according to a or multiple parent values. This is accomplished by appending a required argument, similar to the following, on ant given field:
'required' => array('layout','equals','1')
- The first value of the array is the field ID in which to link the field to.
- The second value is the operation to perform.
- The third value is the value to compare against.
“Required” argument can also be used with multiple “parent” required values.
'required' => array(
If all of these conditions are not met, this field will not be visible and the output CSS will not be used.
|=||$a = $b|
|equals||$a = $b|
|!=||$a != $b|
|not||$a != $b|
|>||$a > $b|
|greater||$a > $b|
|is_larger||$a > $b|
|>=||$a >= $b|
|greater_equal||$a >= $b|
|is_larger_equal||$a >= $b|
|<||$a < $b|
|less||$a < $b|
|is_smaller||$a < $b|
|<=||$a <= $b|
|less_equal||$a <= $b|
|is_smaller_equal||$a <= $b|
|contains||(strpos($a, $b) !== false)|
|doesnt_contain||(strpos($a, $b) === false)|
|not_contain||(strpos($a, $b) === false)|
|not_empty_and||if (!empty($value1) && $value1 != $value2)|
You can nest these requirements as much as you want. If any parent is hidden or doesn’t match the value, all children are hidden and all CSS output from those children is hidden as well.
If the required values are not met, CSS output to both the head and compiler is removed from each field. You can override this on a per field basis by setting
'force_output' => true for each field you want CSS to still be output with. This way you can nest a field under another, and still have it output to the dynamic CSS.
The CSS output will always be visible if items are within a section field (unless that specific field has the required value set to the required parent).