Loading src/Plugin/LayoutField/HideField.php +12 −3 Original line number Diff line number Diff line Loading @@ -22,10 +22,19 @@ class HideField extends LayoutFieldBase { if ($this->getConfiguration('hide')) { $children = Element::children($variables['content']); foreach ($children as $child) { $children_of_region = Element::children($variables['content'][$child]); if (!empty($children_of_region)) { $children_of_regions = Element::children($variables['content'][$child]); if (!empty($children_of_regions)) { foreach ($children_of_regions as $block_key) { $block = $variables['content'][$child][$block_key]; if (!$block) { return; } $children_of_block = Element::children($block); if (!empty($children_of_block)) { return; } } } } $variables['attributes']['class'][] = 'hide-section'; Loading Loading
src/Plugin/LayoutField/HideField.php +12 −3 Original line number Diff line number Diff line Loading @@ -22,10 +22,19 @@ class HideField extends LayoutFieldBase { if ($this->getConfiguration('hide')) { $children = Element::children($variables['content']); foreach ($children as $child) { $children_of_region = Element::children($variables['content'][$child]); if (!empty($children_of_region)) { $children_of_regions = Element::children($variables['content'][$child]); if (!empty($children_of_regions)) { foreach ($children_of_regions as $block_key) { $block = $variables['content'][$child][$block_key]; if (!$block) { return; } $children_of_block = Element::children($block); if (!empty($children_of_block)) { return; } } } } $variables['attributes']['class'][] = 'hide-section'; Loading