data-gjs-custom-name="block_header" (removed from codemirror, or change in html..) #5206
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I have an issue with GrapeJS. After reading other messages on GitHub and the official documentation, I'm stuck with my future CMS Codeigniter, which fully utilizes GrapesJS.
My issue is that I define a custom label (data-gjs-custom-name="block_header") (see the code below).
https://i.imgur.com/CHQ7eNw.jpg
https://i.imgur.com/d45OiEM.jpg
4. Problem: If I open CodeMirror, it erases the data-gjs-custom-name from the HTML, which destroys the label upon subsequent saves.
5. Another problem is that if I modify an element present in this block, such as the text, the label is also lost.
Thank you very much for your help.
I need a code or snippet to avoid these kinds of issues, which are causing a major blockage for me.
// block_header
EBCMS.add('block_header',{
id: 'block_header',
label:
<div class="block_rightlabel"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18"/></svg> <div>Heading</div> </div>
,category: cmsBlocks,
components: 'Some content',
attributes: { class:'gjs-block-section' },
content: {
type: 'block_header' ,
content:
<section class="block_header" data-gjs-custom-name="block_header"> <div class="container"> <div class="row"> <div class="col-lg-12"> <h1>STARTER TEMPLATE</h1> <p>If you just start Andromede CMS Template and are looking for the basics on how to get started editing it, start here.</p> <div class="d-flex"> <div class="btn_blockfull mx-auto">ANDROMEDE CMS</div> <div class="btn_blockborder mx-auto">ANDROMEDE CMS</div> </div> </div> </div> </div> </section>
}
});
Beta Was this translation helpful? Give feedback.
All reactions