我正在以编程方式创建页面并将内容插入到内容块中,但在创建后,我无法通过作曲家对其进行编辑(因为它不是 core_page_type_composer_control_output,而是常规内容块)。有没有办法以编程方式将块添加到页面并让它在 Composer 中运行良好?
我正在使用的相关代码:
$page = Page::getByPath('/articles/xxx');
$block = BlockType::getByHandle('content');
$data = array(
'content' => 'the content',
);
$page->addBlock($block, 'Main', $data);