Opened 10 years ago

Closed 8 years ago

Last modified 8 years ago

#3588 closed New Feature (fixed)

Templates plugin: no option to load from xml file

Reported by: Alfonso Martínez de Lizarrondo Owned by: Alfonso Martínez de Lizarrondo
Priority: Normal Milestone:
Component: General Version: SVN (CKEditor) - OLD
Keywords: Discussion Cc:

Description

Currently the templates plugin only allows to load the data from a js file without an option to use a XML like v2.

This has some drawbacks:

  1. It's not possible to reuse existing templates. Asking the people to rewrite their templates can be a big issue as it might involve other tools that they had setup to provide custom templates for each client.
  2. A json file is more complex to write correctly than a XML. To verify that a XML file is valid they just have to open it in the browser, and it will point to any error. Validating the js file will be more complex and I guess that most of the people will follow the trial and error approach, leading to frustration as now they have to learn the javascript rules in order to make it work.
  3. Managing XML files seems easier to me. I think that any framework has tools to read/write xml files, merging them, etc...

So I suggest to improve the templates plugin allowing to load templates from XML files with the syntax from V2.

Attachments (2)

3588.patch (21.9 KB) - added by Alfonso Martínez de Lizarrondo 9 years ago.
Proposed patch
3582_2.patch (5.8 KB) - added by Alfonso Martínez de Lizarrondo 8 years ago.
Updated patch

Download all attachments as: .zip

Change History (18)

comment:1 in reply to:  description Changed 10 years ago by Garry Yao

Keywords: Pending added

Replying to alfonsoml:

Currently the templates plugin only allows to load the data from a js file without an option to use a XML like v2.

This has some drawbacks:...

The migration would definitely be a obstacle for adapting JSON-based templates, while the pros are significant:

  • cross-domain templates with JSONP
  • PF more better than XML

So perhaps the ultimate solution is going to provide an optional plugin for xml templates migration.

comment:2 Changed 10 years ago by Alfonso Martínez de Lizarrondo

I didn't suggest to remove the new format at all. I know that it's useful to load data cross-domains (although it worries me a little that the file isn't only data, but also includes the code to load that data)

I don't understand what you mean with "PF". Performance? Maybe, but I know that this morning I had to include a new template. In order to do so I just had to open the xml file, copy one of them and then paste in the Html block all the code. I didn't have to worry about how to encode, put quotes or anything else. Paste, save and it's ready.

So this is a reason to allow both systems, but as I said, the most important reason to allow XML is the upgrade from current installs.

comment:3 Changed 10 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.1

comment:4 Changed 10 years ago by Garry Yao

Keywords: Discussion added; Pending removed
Milestone: CKEditor 3.1CKEditor 3.2

comment:5 Changed 10 years ago by Guido

I am doing a migration from FCKEditor to CKEditor now, and too find it a hurdle that the XML format is no longer there. I will consult our users on this but given >100 Kb of templates in XML format, I think this will lead to a no-go.

Allowing loading of the old XML format would allow beter adoptation I think.

comment:6 Changed 10 years ago by Frederico Caldeira Knabben

I think having a tool to convert formats would already be a nice thing... eventually making it possible to edit the template contents in page through a list and a form... contributions are welcome ;)

comment:7 Changed 9 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.2CKEditor 3.3

comment:8 Changed 9 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.3CKEditor 3.x

comment:9 Changed 9 years ago by Guido

Is it expected that that a migration scenario will be available somewhere in the next 3 months? Or does 3.x milestone mean: 'some future release'.

comment:10 Changed 9 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 3.x

Milestone CKEditor 3.x deleted

comment:11 Changed 9 years ago by Charlie

This is really a huge pain to have to convert every style xml, every template xml, etc to JS. I think this is the one place that retro-XML support should exist.

comment:12 Changed 9 years ago by Frederico Caldeira Knabben

Ok, as no one stepped up to provide a conversion tool, here you have it: #6199.

Changed 9 years ago by Alfonso Martínez de Lizarrondo

Attachment: 3588.patch added

Proposed patch

comment:13 Changed 9 years ago by Alfonso Martínez de Lizarrondo

Owner: set to Alfonso Martínez de Lizarrondo
Status: newreview

The patch provides this feature as an optional plugin.

The ajax and xml plugins are the _source/core files that usually aren't deployed, turned into plugins so they can be loaded on demand.

The new contents of _samples/assets are just the sample files from FCKeditor

There's a new sample to test the behavior and explain it. It's possible to load both JS and XML templates by requiring that Xml ones are prefixed in the config array with "xml:"

Changed 8 years ago by Alfonso Martínez de Lizarrondo

Attachment: 3582_2.patch added

Updated patch

comment:14 Changed 8 years ago by Alfonso Martínez de Lizarrondo

I've uploaded a new patch with just the new files as the changes about the XML and AJAX plugins have been done in 3.5.3 and I've released the plugin as a standalone in http://alfonsoml.blogspot.com/2011/04/migrating-from-fckeditor-is-little.html

comment:15 Changed 8 years ago by Alfonso Martínez de Lizarrondo

Resolution: fixed
Status: reviewclosed

As I said, that blog post links to a standalone plugin and no changes are required now for he core.

I don't think that there's a real need to add this to the core in the current situation, so I'm just closing the ticket.

comment:16 in reply to:  15 Changed 8 years ago by Frederico Caldeira Knabben

Replying to alfonsoml:

I don't think that there's a real need to add this to the core in the current situation, so I'm just closing the ticket.

Totally agreed.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy