Skip to content
Discussion options

You must be logged in to vote

@adam3278

For myself, I did a little the opposite, not GrapesJs in the site, but parts of the site in the editor itself.

Header:

export default (editor: TEditor) => {
  axiosInstance
    .post(...get_header_params...)
    .then((response: any) => {
      const canvasBody = this.canvas.getBody();
      const contentWrapper = document.createElement('div');
      contentWrapper.classList.add('gjs-website-header');
      contentWrapper.innerHTML = response.html;
      canvasBody.prepend(contentWrapper);
    })
    .catch(error => {
      ...
    });
};

and canvasBody.append(contentWrapper); for footer.

Maybe this will work for you too.

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@adam3278
Comment options

@mosh-tudor
Comment options

@artf
Comment options

artf Mar 11, 2024
Maintainer

Answer selected by adam3278
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants