- Issue created by @jaydee1818
46:58 56:40 Running- Status changed to Closed: won't fix
9 months ago 7:15am 4 April 2024 - π©πͺGermany vincent.hoehn Dresden, Germany
Hello Jonathan,
Thank you very much for creating the issue and the effort for the patch.
The patch deletes the complete content of the editor before inserting a new template.
This is not a problem if the node is new and only one template is included, which is then βchangedβ.
However, this is disastrous if large and important content already exists. This is then removed.For example, we use Drupal to create our manuals for our software. We use the template module to easily add recurring content such as notes, images, warnings, etc. Some text is several pages long, applying the patch and inserting a template would destroy the content.
BR
Vincent - π©πͺGermany dbielke1986
I see it the same way. Completely removing the content is fatal for many use cases.
Regarding the actual problem, please take a look at the linked items.
- π¦πΊAustralia jaydee1818 Melbourne
Ok then - how about this idea. Add the option to override the current template? Set to false by default but change it to true if that behaviour suits your use-case?
{ "title": "Banner Variant One", "icon": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z\"/></svg>", "description": "2-col - LHS: Text, RHS: Image", "override": true, "html": "<div>My template</div>" },
- π©πͺGermany vincent.hoehn Dresden, Germany
I don't think we can implement it that easily.
With override=true, the source code would have to go through the content and find the template. But what if there are several identical templates in the document?Moreover, the entire logic would have to be rebuilt, as the additional key in the JSON would have to become a recursive function. I don't know if it's worth the effort, I think manual deletion is the more suitable option.