Grapesjs: Can we use grapesjs for editing and saving existing template.

Created on 9 Jan 2017  路  3Comments  路  Source: artf/grapesjs

I have installed graphesjs and created custom template newly.but I want to edit existing template by using grapesjs.Is that feature include this awesome liabary? Is that can be achieve.?

outdated

Most helpful comment

Hi @desilvaNSP
for import you can use this API:

var editor = grapesjs.init({...});
editor.setComponents('<div class="cls">Your template</div><style>...</style>');
// Or add CSS separately
// editor.setStyle('.cls{color: red}');

But GrapesJS is class-based so only CSS rules like these are parsed by the editor:

.class1 {...}
.class1.class2 {...}
.class1.class2, .class3 {...}

For example templates made with BEM methodology are perfect for GrapesJS

All 3 comments

the template/theme has to be a grapejs project

Hi @desilvaNSP
for import you can use this API:

var editor = grapesjs.init({...});
editor.setComponents('<div class="cls">Your template</div><style>...</style>');
// Or add CSS separately
// editor.setStyle('.cls{color: red}');

But GrapesJS is class-based so only CSS rules like these are parsed by the editor:

.class1 {...}
.class1.class2 {...}
.class1.class2, .class3 {...}

For example templates made with BEM methodology are perfect for GrapesJS

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kawika-connell picture kawika-connell  路  3Comments

ryandeba picture ryandeba  路  3Comments

mathiasbc picture mathiasbc  路  3Comments

crazyxhz picture crazyxhz  路  3Comments

krunal039 picture krunal039  路  3Comments