Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Editor layout to Editor Layout #44

Open
moomoo-dev opened this issue May 29, 2023 · 4 comments
Open

Add Editor layout to Editor Layout #44

moomoo-dev opened this issue May 29, 2023 · 4 comments

Comments

@moomoo-dev
Copy link

Would you know of a way to add at least another level of Editor Layout to editor layout other than creating a bunch of copy's of the same object?

@moomoo-dev
Copy link
Author

Actually i think I found it, I'm going to try to add a configuration that will allow you to add levels of copy.

@moomoo-dev
Copy link
Author

I figured out how to do this with vanilla JS, but I need to figure how to do it with Typescript. So hopefully by next week I can have this knocked out.

@AstralBaby
Copy link

hey did you find a workaround?

@moomoo-dev
Copy link
Author

hey did you find a workaround?

Yes, while I'm still looking for the way to infinite nested levels... I had to put the project that I was using this on hold.. but you can copy your base config that had the editorJS Layout component. So the editorJSConfig will go into editorConfig..... I'm trying to figure out how I can nest finitely.

let editorJSConfig = {

add_another_layout_here1: {

},
add_another_layout_here2: {

},
header: {
class: Header,
inlineToolbar: true,
//https://editorjs.io/configuration/#inline-toolbar-order
// tunes: ['anyTuneName']
},
};

let editorConfig = {
oneheader: {
class: EditorJSLayout.LayoutBlockTool,
config: {
EditorJS,
editorJSConfig, //<---- add a copy of your base config here
enableLayoutEditing: false,
enableLayoutSaving: true,
initialData: {
itemContent: {
1: {
blocks: [{
type: "paragraph",
data: {
text: "Start typing here",
},
}, ]
},
},
layout: {
type: "container",
id: "",
className: "",
style: "",
children: [{
type: "item",
id: "",
className: "",
style: "",
itemContentId: "1",
}, ],
},
},
},
toolbox: {
icon: ``,
title: "1 column",
},
}
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants