question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding new components to Block Manager

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sakshigarg9commented, Mar 7, 2019

OHH alright, worked, thanks!

1reaction
arthuralmeidapcommented, Mar 6, 2019

The id is used internally to track each block individually. As @WebEtSolutions said you should put unique identifiers to each new block

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found