- Issue created by @edwardsay
- 🇬🇧United Kingdom jacobupal Leeds
Amazing, thank you! Can't wait to try this... just need to untangle myself from my previous solution so I can test it.
Configurable-per-template is ideal for now. Not every template will need the extra markup, as it may not contain divs or similar. E.g. I'm using this module to store common tokens, and no wrapper elements are needed there. Cleaner markup is going to be preferred wherever possible which a toggle would allow.
In the long term we will want this to be addressed by this upstream issue in CKEditor5: https://github.com/ckeditor/ckeditor5/issues/6462 making these wrapper elements obsolete. In which case the fewer the instances of these wrapper elements being used now, the fewer will need to be removed later, also made possible by the use of a per-template-toggle. That is of course, if we ever get a solution to the upstream issue.
- 🇫🇷France steveoriol Grenoble 🇫🇷
A template like this :
<div class="grid-x grid-margin-x"> <div class="cell small-12 medium-6"> <div class="zonetemplate"> <p>colonne 1</p> </div> </div> <div class="cell small-12 medium-6"> <div class="zonetemplate"> <p>colonne 2</p> </div> </div> </div>
Gives this render :
<section class="ckeditor-template-wrapper"> <div class="ckeditor-template-content"> <div class="grid-x grid-margin-x"> <div class="cell small-12 medium-6"> <div class="zonetemplate"><p>colonne 1</p></div> </div> <div class="cell small-12 medium-6"> <div class="zonetemplate"><p>colonne 2</p></div> </div> </div> </div> </section>
But, it could be a little better if there was a way to do something like this:
<section class="ckeditor-template-wrapper"> <div class="grid-x grid-margin-x"> <div class="cell small-12 medium-6"> <div class="ckeditor-template-content"><p>colonne 1</p></div> </div> <div class="cell small-12 medium-6"> <div class="ckeditor-template-content"><p>colonne 2</p></div> </div> </div> </section>
- First commit to issue fork.
- 🇨🇦Canada chrisck BC, Canada
Patch #2 works extremely well for me and IMO should be part of the ckeditor_templates module. The editing experience using
is pretty terrible without it. As @edwardsay says, this is the magicline equivalent. - 🇮🇹Italy nicoschi
The patch works well, maybe it lacks only another element, a selection handler which allowa to select the entire template and delete it if needed, something similar to the handler in the table widget.
I'm try to figure out how to add it but I'm extremily uncomfortable with the code logic of ckeditor plugins.