#Migrate two Blocks into one
6 messages · Page 1 of 1 (latest)
Help is on the way! To mark it as solved, use the /solve command. In the meantime, here are some existing threads that may help you:
Documentation:
- Blocks Field - Block Configs
- Blocks Field - Admin Options - Customizing the way your block is rendered in Lexical
- Upload Field
- Rich Text Editor - Features overview
- Migrations - Migration file contents
Community-Help:
I think the easiest way would be to mabe combined field with mediaBlock fields, your custom mediaBlock fields and additional field "type" which define what kind of mediaBlock you want to use
Something like that:
export const combinedMediaBlock = (): Field => ({
name: 'mediaBlock',
label: {
en: 'Media Block',
},
interfaceName: 'mediaBlock',
type: 'group',
fields: [
{
type: 'select',
name: 'type',
label: {
en: 'Type',
},
options: [
{
label: {
en: 'Default',
},
value: 'default',
},
{
label: {
en: 'Custom',
},
value: 'custom',
},
],
},
{
type: 'group',
name: 'default',
fields: mediaBlockFields(),
admin: {
condition: (_data, siblingData) => siblingData?.type === 'default',
},
},
{
type: 'group',
name: 'custom',
fields: customMediaBlockFields(),
admin: {
condition: (_data, siblingData) => siblingData?.type === 'custom',
},
},
],
});
Its not like that I want to remove my old Block and jsut have one currently I have the default MediaBlock and a CustomMediaBlock but they do exactly the same but are stored differently in the DB. I Just want to migrate the CustomMediaBlock to a MediaBlock