Issue #1034Opened April 12, 2018by vladbpython0 reactions

insert element or block inside parent element

Question

Good day, i have component, have block

editor.BlockManager.add("bootstrap-container", {
     attributes: {class: "gjs-fonts gjs-f-b1 gjs-block gjs-one-bg gjs-four-color-h"},
     category: "test",
     label: "Test",
     content: '<div class="container" style="min-height:10px;"></div>'
   });

i have Trait on listen changes, how can I add "h1 " inside that block "'<div class="container" style="min-height:10px;"></div>". How to add tag inside this model like:

doStuff(){
                 var coll = this.collection;
                 var at = coll.indexOf(this)
                  coll.add('<h1>Hello world</h1>', { at });
}

Answers (3)

artfApril 14, 20180 reactions

Given the current model you can add other components in this way model.components('<h1>Hello world</h1>')

ionic666May 8, 20180 reactions

@vladbpython hi,do you solve this problem?i also want to know how to drag one element into parent element.

lock[bot]September 17, 20190 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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.