Id Added Blocks #6488
Unanswered
yosefmekkawy
asked this question in
Q&A
Id Added Blocks
#6488
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am working on a plugin that allows the users to create their own blocks and also reuse it , the issue is that i need to make any block used exported html just a div with that block id and show the preview in the editor normally. the issue i am facing currently is that if any nested component has a custom view it does not render as the custom view but instead it renders the html , it was working fine if i used blocks but i need to handle the case where the view is different from the model , is there a way to make the component render the custom components view normally or use blocks but seperate the model from the view ?
`export function RegisterComponents(editor: Editor, blocks: UserBlock[]) {
blocks.forEach((block: UserBlock) => {
editor.DomComponents.addType(DYNAMIC_COMPONENT_TYPE + -${block.id}, {
isComponent: el => el?.dataset?.blockId == block.id,
`}
Beta Was this translation helpful? Give feedback.
All reactions