function LayoutBuilderEntityViewDisplay::getDefaultSection
Gets a default section.
Return value
\Drupal\layout_builder\Section The default section.
1 call to LayoutBuilderEntityViewDisplay::getDefaultSection()
- LayoutBuilderEntityViewDisplay::setComponent in core/
modules/ layout_builder/ src/ Entity/ LayoutBuilderEntityViewDisplay.php - Sets the display options for a component.
File
-
core/
modules/ layout_builder/ src/ Entity/ LayoutBuilderEntityViewDisplay.php, line 470
Class
- LayoutBuilderEntityViewDisplay
- Provides an entity view display entity that has a layout.
Namespace
Drupal\layout_builder\EntityCode
protected function getDefaultSection() {
// If no section exists, append a new one.
if (!$this->hasSection(0)) {
$this->appendSection(new Section('layout_onecol'));
}
// Return the first section.
return $this->getSection(0);
}