Can i add my own attribute inside the BlockManager.add ?
It works as expected https://jsfiddle.net/90y7wuo8/ Next time create a reproducible demo
Read full answer below ↓Question
editor.BlockManager.add('testBlock' + i, { label: 'Box' + i, attributes: { MyAttribute: 'hi'}, content: html })
Can i do something like that ? or i need to use standard html attributes?
I tried, but didn't work
Thank you.
Answers (1)
It works as expected https://jsfiddle.net/90y7wuo8/ Next time create a reproducible demo
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3207
Form is not submitting
I am trying to create as custom block. But the form is not submitting when i use components inside content. I am able to get all the form d...
Issue #3626
How to set src of video tag at dynamic?
Hi @artf , Hi I have drag and drop video tag and button from blockmanager, On Clicking the button , I need to change the url to src. But no...
Issue #792
Script property using function don't work with blocks
In Components & JS docs there's this example: This works perfectly. But I couldn't use a function instead of a string in script, as is said...
Issue #1831
[Question] How to run command for a block component?
I'd like to do something like this. so once a user drops the test component into the canvas, I'd like to open up asset manager modal where...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.