Issue #2061๐Ÿ’ฌ AnsweredOpened June 2, 2019by froderf0 reactions

How to place a component at the end of the canvas.

Quick answerby artf

You can use something like this

Read full answer below โ†“

Question

How can I put my footer at the end of the canvas?

I want the editor to not allow placing a block/widget below the footer.

example


<!-- only allow dragging/placing of widgets here -->

FOOTER
<!-- Should not have blocks/widgets below this -->

Answers (3)

artfโ€ข June 13, 2019

You can use something like this

const footer = '<div style="padding: 100px">My footer</div>';
editor.getWrapper().getEl().insertAdjacentHTML('afterEnd', footer);
froderfโ€ข June 15, 2019

@artf Do we have something like removeAdjacentHTML() editor.getWrapper().getEl().removeAdjacentHTML('afterEnd', footer); because when we used it keeps duplicating every after you reload the window. -------------- I'm looking for a way to solve this but no luck :( Seems like a bug?

artfโ€ข June 15, 2019

Do we have something like removeAdjacentHTML()

getEl() gives you the HTMLElement instance so insertAdjacentHTML is from DOM API, not GrapesJS

it keeps duplicating every after you reload the window.

... can you create a reproducible demo?

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.