GJS Canvas inside actual website #5732
-
Hello, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
I'm not sure I understand your use case, what do you mean by |
Beta Was this translation helpful? Give feedback.
-
GrapesJS allows me to create very powerful content drag&drop editor, but the created content is being displayed over the canvas (frame-frapper) that does not look as the actual website. If you project the whole website there is no problem, but when you use gjs to project the content for CMS pages there is a problem. Most of my app users would use the simplest fixed dimensions, so if they don't see the content fit the proper page with the whole layout, they would be very unhappy. The solution is to display the proper website under the gjs canvas, but the question is - is there any built-in way to do this? Would the gjs break if I move the container myself via js? |
Beta Was this translation helpful? Give feedback.
-
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 Maybe this will work for you too. |
Beta Was this translation helpful? Give feedback.
@adam3278
For myself, I did a little the opposite, not GrapesJs in the site, but parts of the site in the editor itself.
Header:
and
canvasBody.append(contentWrapper);
for footer.Maybe this will work for you too.