Issue #1686Opened December 27, 2018by Sridhar-M0 reactions

CMS: Grapesjs is not defined

Question

I am trying to use basic Grapesjs editor to CMS. Here's my code:

<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
<script src="https://unpkg.com/[email protected]/dist/grapes.js"></script>
<style>
    body,
    html {
        height: 100%;
        margin: 0;
    }
</style>

<div id="gjs" style="height:0px; overflow:hidden">
    <div style="margin:100px 100px 25px; padding:25px; font:caption"> This is a sample text</div>
</div>


<script type="text/javascript">
    alert('Start');
    var editor = grapesjs.init({
        height: '100%',
        showOffsets: 1,
        noticeOnUnload: 0,
        storageManager: {autoload: 0},
        container: '#gjs',
        fromElement: true,

        plugins: ['gjs-blocks-basic', 'gjs-plugin-actions'],
        pluginsOpts: {
            'gjs-plugin-actions': {},
            'gjs-blocks-basic': {
                flexGrid: 1
            }
        }
    });
    window.editor = editor;
    alert('end');
</script>

I have installed the grapesjs using NPM. Later I tried running this html file in the local, as expected the output was Grapesjs editor. I used this same file in CMS and I am getting grapesjs is not defined.

Answers (2)

lock[bot]December 28, 20190 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.