插件安装时无法创建锁定的 CMS 布局
Not able to create locked CMS layout while plugin installation time
我试图在安装插件时创建一个锁定的 CMS 布局,但它并没有创建一个锁定的布局。
这是代码,
$page = [
[
'id' => Uuid::randomHex(),
'type' => 'page',
'name' => 'Test',
'locked' => 1,
'sections' => [
[
'id' => Uuid::randomHex(),
'type' => 'default',
'locked' => 1,
'position' => 0,
'blocks' => [
[
'locked' => 1,
'position' => 0,
'type' => 'image-cover',
'slots' => [
['type' => 'image', 'locked' => 1, 'slot' => 'image']
]
]
]
]
]
]
];
有什么我遗漏的吗?
需要说明的是,cms_page
没有 locked
属性,但只有一个数据库列可以设置锁定布局。因此您需要在迁移时添加它或在创建特定布局后更改 table。
我试图在安装插件时创建一个锁定的 CMS 布局,但它并没有创建一个锁定的布局。 这是代码,
$page = [
[
'id' => Uuid::randomHex(),
'type' => 'page',
'name' => 'Test',
'locked' => 1,
'sections' => [
[
'id' => Uuid::randomHex(),
'type' => 'default',
'locked' => 1,
'position' => 0,
'blocks' => [
[
'locked' => 1,
'position' => 0,
'type' => 'image-cover',
'slots' => [
['type' => 'image', 'locked' => 1, 'slot' => 'image']
]
]
]
]
]
]
];
有什么我遗漏的吗?
需要说明的是,cms_page
没有 locked
属性,但只有一个数据库列可以设置锁定布局。因此您需要在迁移时添加它或在创建特定布局后更改 table。