Skip to content
Snippets Groups Projects
Commit 023031b9 authored by Ivan Doroshenko's avatar Ivan Doroshenko :flag_ua:
Browse files

Fixed the position of lb sections/blocks on Home page.

parent 6f14ff59
No related branches found
No related tags found
1 merge request!37Added missing image and summary fields.
......@@ -59,7 +59,6 @@ migration_dependencies:
- uw_ct_event
- uw_ct_profile
- uw_body_sections_lb
- uw_cbl_banner_images_lb
# Embedded blocks.
- uw_cbl_copy_text
- uw_cbl_remote_video
......
......@@ -37,6 +37,7 @@ process:
message: 'Destination node was not found.'
layout: layout
layout_settings: layout_settings
section: delta
destination:
plugin: layout_builder:section
migration_dependencies:
......
......@@ -27,7 +27,7 @@ process:
default_value: 0
region:
plugin: default_value
default_value: 'content'
default_value: 'first'
delta:
plugin: default_value
default_value: 0
......@@ -38,4 +38,5 @@ destination:
plugin: layout_builder:block
migration_dependencies:
optional:
- uw_body_lb
- uw_cbl_banner_images
......@@ -86,12 +86,17 @@ class LayoutBuilderSection extends DestinationBase implements ContainerFactoryPl
$layout = $node->get('layout_builder__layout');
$section = new Section($row->getDestinationProperty('layout'), $row->getDestinationProperty('layout_settings'));
$layout->appendSection($section);
$delta = $row->getDestinationProperty('section');
if (isset($delta)) {
$layout->insertSection($delta, $section);
}
else {
$layout->appendSection($section);
$delta = $layout->count() - 1;
}
$node->changed->preserve = TRUE;
$node->save();
$delta = $layout->count() - 1;
return [$node->id(), $delta];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment