Issue #2434πŸ’¬ AnsweredOpened November 29, 2019by pvbergen1 reactions

Exclude html elements from model

Quick answerby pvbergen❀ 1

Huh, that would be surprisingly simple. Thanks! I'll test it out in the next few days and see how we can integrate it with our workflow.

Read full answer below ↓

Question

This is a broad question, so I will provide the use case and some ideas instead of actual code.Basic description We are using grapesjs as part of a Drupal module (https://github.com/artf/grapesjs/issues/1798#issuecomment-559498604) and we are facing an issue with having too many html elements within the grapes container. This impacts the performance for users. The idea we follow with the module is to show the whole page within the grapes iframe. This enables the user to see the page as whole and allows us to utilize the tablet and mobile view modes. Due to the thousands of elements in header...

Answers (2)

pvbergenβ€’ November 30, 2019

Huh, that would be surprisingly simple. Thanks! I'll test it out in the next few days and see how we can integrate it with our workflow.

artfβ€’ November 30, 2019

Do you mean something like this?

const header = '<div style="padding: 100px">My header</div>';
editor.getWrapper().getEl().insertAdjacentHTML('beforeBegin', header);

This will add an HTML without being actually related to GrapesJS Components

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 β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.