ckeditor icon indicating copy to clipboard operation
ckeditor copied to clipboard

`ckeditor/convert/matrix` command

Open i-just opened this issue 1 year ago • 1 comments

Description

Adds ckeditor/convert/matrix command which takes a handle of a Matrix field you want to change into a CKEditor field.

You can choose to convert the field as is, meaning the content of the converted CKEditor field will contain “just” the nested entries.

Or, you can choose which field from which entry type should be used to populate the content of the converted CKEditor field alongside the nested elements. The field you select needs to be a Plain Text or CKEditor field. If you go down this route, the selected entry type is duplicated sans the chosen field, and that duplicate is used in the converted CKEditor field. If the field you selected is the CKEditor field, the same CKEditor Config will be used unless it doesn’t contain createEntry, in which case the config will be duplicated and createEntry will be added to it.

The command is split into two steps. The first one converts the selected Matrix field to a CKEditor field. The second part converts the content of the Matrix field to content that the CKEditor field can work with.

After running the command, the Project Config and content will be adjusted. After the command has finished processing the data, you get the version of the command you should run after deploying the changes to staging/production, which will only convert the content as the field will have been converted via applying the project config.

There’s a corresponding PR in the cms repo, which is needed in order to use the yii\console\Controller->select() with a $default parameter.

Related issues

cms-1093

i-just avatar May 29 '24 16:05 i-just