Issue #3100πŸ’¬ AnsweredOpened October 28, 2020by stljeff10 reactions

Adding external libraries after dragging custom block

Quick answerby GoodPHP

Hi, If you didn't find answer here, you can contact with Devfuture Team: https://devfuture.pro/contact/ We specialise on GrapesJS.

Read full answer below ↓

Question

Hi, I am customizing GrapesJS by creating components/blocks my users can drag onto the canvas. A number of these blocks depend upon external libraries like Bootstrap and FontAwesome.. Is there a way to check to see if the necessary dependencies are included on a page, and if not, add them to the page? Here is what I already know. I am hoping that someone can help me fill in the gaps of my GrapesJS understanding, or point me in a helpful direction.I am aware that I can tap into drag and drop events when a user places a block on a page. However, I can only tap into the 'block:drag:stop' event f...

Answers (3)

GoodPHPβ€’ October 30, 2020

Hi,

If you didn't find answer here, you can contact with Devfuture Team: https://devfuture.pro/contact/

We specialise on GrapesJS.

artfβ€’ November 9, 2020

@stljeff1 the correct way is to use Component related scripts which check if the dependency exists

stljeff1β€’ November 12, 2020

@artf Can I do that with CSS files? Nonetheless, I did manage to "solve" my problem by creating a custom type for the blocks with any kind of dependency (CSS or JS). This custom type extends the default view by adding a custom callback when blocks of that type are placed on canvas. When this callba...

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

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Related tutorials

In-depth guides on the same topic.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.