I’m working on migrating content from fieldable panels panes in D7 to Layout Builder in D8. So far, I’ve managed to extract the content I need from my D7 database, but I’ve been unable to add that content to layout builder section components. Backing up a bit, I’m currently trying to just add some inline blocks with sample content to a layout builder section in an attempt to determine how to populate the fields, as follows:
/* Add an inline block of 'basic' type to a section 'basic' blocks only have a field called "body" of type "Text (formatted, long, with summary)" */ $section = new Section('two_column'); $testcomponent = new SectionComponent($this->uuid->generate(), 'first', ( 'id' => 'inline_block:basic', 'label' => 'Test component label', 'label_display' => 'visible', 'body',( 'value'=>'Test', 'format'=>'limited_html_text', ) )); $section->appendComponent($testcomponent);
After I run my migration, I end up with a node with a inline block of “basic” type in the “first” region, as expected, but it’s empty aside from the label. Could someone advise me on how to set field values for section components?