Search code examples
symfonyshopware

Not able to create locked CMS layout while plugin installation time


I'm trying to create a locked CMS layout while installing the plugin, but it's not creating a locked layout. Here is the code,

$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']
                            ]
                        ]
                    ]
                ]
            ]
        ]
    ];

Is there something that I'm missing?


Solution

  • Just to be clear that cms_page doesn't has locked property, but there is only a database column to set the locked layout. So you need to add it while migration or alter the table after creating a particular layout.