Adding new components to Block Manager
See original GitHub issueI’m trying to add multiple components which are in my canvas into the block manager but I believe because of an id issue they’re not visible properly. What exactly does the id refer to? Here’s my code:
const bm = editor.BlockManager;
bm.add("social-sign-in-butttons-section", {
label: "Facebook sign-in",
content:
'<div class="pull-left social-sign-in-button padding-right-small" data-gjs-droppable=".fa .fa-facebook-square">' +
'<img data-gjs-draggable=".social-sign-in-button" src="facebook.png" id="facebook" title="facebook" class="fa fa-facebook-square fa-3x ">' +
"</img>" +
"</div>",
attributes: {
class: "fa fa-facebook"
}
});
bm.add("the-row-block", {
label: "GooglePlus sign-in",
content:
'<div class="pull-left social-sign-in-button padding-right-small">' +
'<img src="google.png" id="googleplus" title="googleplus" class="fa fa-google-plus-square fa-3x ">' +
"</img>" +
"</div>",
attributes: {
class: "fa fa-google-plus-square"
}
});
bm.add("the-row-block", {
label: "LinkedIn sign-in",
content:
'<div class="pull-left social-sign-in-button padding-right-small">' +
'<img src="linkedin.png" id="linkedin" title="linkedin" class="fa fa-linkedin-square fa-3x">' +
"</img>" +
"</div>",
attributes: {
class: "fa fa-linkedin-square"
}
});
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Block Manager - GrapesJS
A Block is a simple object which allows the end-user to reuse your Components. It can be connected to a single Component or...
Read more >Adding component to blockManager in GrapesJS
You can create a component with "div container" { 'id' : '0001', 'data' : { label: `<div> <div class="my-label-block">Container</div> ...
Read more >Creating a Member Block Component - Oracle Help Center
In System View, right-click a rule or a template, and then select Open. After you determine where in the flow chart you want...
Read more >Block Manager - CADWorx - Help
Adds the block name, layer name and coordinates of each component of the current drawing into the columns of corresponding database tables. Update...
Read more >Building blocks: Crafting components - YouTube
For the second Building blocks stream, Chad and Jacob dive into style refinement, component creation from sticker sheets, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OHH alright, worked, thanks!
The id is used internally to track each block individually. As @WebEtSolutions said you should put unique identifiers to each new block