X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Flayout_builder%2Flayout_builder.install;fp=web%2Fcore%2Fmodules%2Flayout_builder%2Flayout_builder.install;h=acb1e4fdf3d9cc6bdcf3a5e39a95e89557fe9c48;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/web/core/modules/layout_builder/layout_builder.install b/web/core/modules/layout_builder/layout_builder.install new file mode 100644 index 000000000..acb1e4fdf --- /dev/null +++ b/web/core/modules/layout_builder/layout_builder.install @@ -0,0 +1,40 @@ +getThirdPartySettings('field_layout'); + if (isset($field_layout['id'])) { + $field_layout += ['settings' => []]; + $display->appendSection(new Section($field_layout['id'], $field_layout['settings'])); + } + + // Sort the components by weight. + $components = $display->get('content'); + uasort($components, 'Drupal\Component\Utility\SortArray::sortByWeightElement'); + foreach ($components as $name => $component) { + $display->setComponent($name, $component); + } + $display->save(); + } + + // Clear the rendered cache to ensure the new layout builder flow is used. + // While in many cases the above change will not affect the rendered output, + // the cacheability metadata will have changed and should be processed to + // prepare for future changes. + Cache::invalidateTags(['rendered']); +}