How can I include html/bootstrap in bockly toolbox or my own blocks made using bootstrap

111 views
Skip to first unread message

Rahul Pandit

unread,
Aug 22, 2018, 7:08:08 AM8/22/18
to Blockly
I am new to blockly. Any help will be really appreciated

I am trying to use some HTML in the toolbox. 
Like having a select dropdown, and then selecting values from the dropdown will generate blocks according to the selected values.
The toolbox is an XML and I am unable to use Htmlin that.

Can anyone help with this? Please

Rachel Fenichel

unread,
Aug 22, 2018, 1:00:44 PM8/22/18
to Blockly
Deciding which blocks you want on the fly means you want a dynamic category.  That's a thing that Blockly supports.  But you are correct that we don't support adding arbitrary HTML to the toolbox.  You'd have to make some pretty involved changes to the toolbox and flyout classes.  The closest example is probably the flyout button class.

Rachel

Rahul Pandit

unread,
Aug 24, 2018, 4:16:14 AM8/24/18
to Blockly
Thanks Rachel for the information. I have to do some changes with html in blockly. I am trying but it seem quite difficult to do so. Do you have any idea about what needs to be done if I want to replace the blocks shape with my own build custom SVG blocks. Do we have any documentation for that. I tried searching but found nothing about it.

Rachel Fenichel

unread,
Aug 24, 2018, 2:37:27 PM8/24/18
to Blockly
Changing the shape of the blocks will mostly involve changes in block_render_svg.js.  There are a lot of constants to describe all of the parts of the block (corners, connections, etc) and lots of logic to decide when and where to place each SVG segment.  All of the constants and functions are documented with JSDoc, but there are no guides for making changes to the rendering.

Rachel
Reply all
Reply to author
Forward
0 new messages