How to customize View Code functionality in grapesjs-plugin-boilerplate?
ERROR in Template execution failed: ReferenceError: editor is not defined Without showing your code the error is useless... definitely, you forgot something somewhere, try to debug... BTW grapesjs-plugin-boilerplate is deprecated, you have to use grapesjs-cli
Read full answer below βQuestion
Hi
I am using grapesjs-plugin-boilerplate to develop my grapesjs ui builder. My requirement is to customize the View Code (</>) feature in the ui builder to display the contents from editor.getHml() enclosed by html tag as below:
<html>
<head>
</head>
<body>
${editor.getHtml()}
</body>
</html>
I followed the solution mentioned in [#523](https://github.com/artf/grapesjs/issues/523) and https://developer.aliyun.com/mirror/npm/package/grapesjs-plugin-export. Both these solutions are wrt grapesjs-export-plugin. Also on implementing the solution mentioned in the above mentioned references I got the below error:
**ERROR** in Template execution failed: ReferenceError: editor is not defined
Any guidance on this issue would be of immense help
Thank you.Answers (1)
ERROR in Template execution failed: ReferenceError: editor is not defined
Without showing your code the error is useless... definitely, you forgot something somewhere, try to debug...
BTW grapesjs-plugin-boilerplate is deprecated, you have to use grapesjs-cli
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3347
How can I get Uncompressed JS code for me to edit?
Hi, thank you for reviewing my problem. I want to use my own JSEditor to edit htmlγcss and js. 1γFirst, I use getHtml, getCss, getJs to dis...
Issue #3730
Script tag not rendering in HTML page
I created the component as below. site_1 - is my readymade template and it has CSS and javascript. CSS loads properly with the "content" bu...
Issue #1746
[FEATURE REQUEST] Don't Strip off html , head and body tags from imported html
Hi Team, We have noticed grapesjs has customised the actual template uploaded, by stripping off the html, head and body tags and adds new s...
Issue #948
[Question] Grapejs import allow body class
I've imported full html string include head, body tag, and body tag has some classes. When I use editor.getHtml() => I can't get body tag....
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins β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.
Tutorial
How to Build a Production GrapesJS Editor: The Complete Walkthrough of Brief, Preset, Plugins, and Services
A complete walkthrough of building a production GrapesJS editor: how to choose a preset, pick plugins, and scope setup services without burning a sprint.
Tutorial
Embed GrapesJS in Your SaaS: A Weekend Guide
Embed GrapesJS in your SaaS and ship a white-label page builder over a weekend. Honest tradeoffs, real code, and the plugins that close the UX gap.
Tutorial
Big Updates: TinyMCE 8 and Placeholder 2.0 for GrapesJS
In May we shipped major updates to two of our most popular GrapesJS plugins β TinyMCE Inline Text Editor and Placeholder.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.