protected function PatternLayout::processOnlyContentFields in UI Patterns 8
Remove default field template if "Only content" option has been selected.
Parameters
array $regions: Layout regions.
1 call to PatternLayout::processOnlyContentFields()
- PatternLayout::build in modules/
ui_patterns_layouts/ src/ Plugin/ Layout/ PatternLayout.php - Build a render array for layout with regions.
File
- modules/
ui_patterns_layouts/ src/ Plugin/ Layout/ PatternLayout.php, line 177
Class
- PatternLayout
- Class LayoutDefault.
Namespace
Drupal\ui_patterns_layouts\Plugin\LayoutCode
protected function processOnlyContentFields(array &$regions) {
foreach ($regions as $region_name => $region) {
if (is_array($region)) {
foreach ($regions[$region_name] as $field_name => $field) {
if (is_array($field) && isset($field['#theme']) && $field['#theme'] == 'field') {
$regions[$region_name][$field_name]['#theme'] = NULL;
}
}
}
}
}