Issue #1863Opened March 6, 2019by sakshigarg93 reactions

Adding new components to Block Manager

Question

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"
    }
  });

Answers (3)

WebEtSolutionsMarch 6, 20191 reactions

Hi,

Your LinkedIn sign-in id is the same that your GooglePlus sign-in. The key of block must be unique.

Bye

arthuralmeidapMarch 6, 20191 reactions

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

sakshigarg9March 7, 20191 reactions

OHH alright, worked, thanks!

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.