客户想要从文字处理器复制/粘贴;富文本编辑器会让事情变得一团糟。我们如何解决这个问题?
经过多年定制 CMS 系统的经验,我得出这样的结论:
- 客户确实希望将信息从文字处理器复制并粘贴到他们的网站 CMS 中。他们不喜欢在网站框中创建大文本,而更喜欢使用他们的老式文字处理程序来创建大文本。或者他们只是已经为其他目的准备了文本,因此想要复制和粘贴。
- 客户不喜欢丢失他们的格式。他们在粗体文本、标题等上花费了时间,并且不喜欢再次这样做。
- 富文本格式字段(TinyMCE、CKEditor 等)尚无法将所有格式化文本正确转换为正确的 HTML。我不责怪他们;考虑到文字处理器放入剪贴板的奇怪“源代码”,这一定非常困难。但是阅读所有有关 Richttext 相关问题的主题,我觉得这是一个已知的限制。
在这种情况下你会怎么做?我已经尝试过以下操作:
- 事先向客户解释这不是我们正在实现的文字处理器,并且它有局限性。他们能理解,但还是想复制粘贴。
- 只显示很少的格式化按钮(粗体、斜体、链接)。这样,我们就可以剥离标签并很好地清理它,这限制了问题。效果更好,但客户不断要求提供字体选项、更多颜色、标题等。
因此,这并不是一个很好的解决方案。还有其他人成功解决了这个问题吗?
After years of experience with custom made CMS systems, I come to this conclusion:
- Clients really want to copy and paste information from word processors into their website CMS. They don't like to create large texts in a website box, and prefer to do so from their good old word processor. Or they simply have their text already prepared for other purposes, and therefore want to copy and paste.
- Clients do not like to lose their format. They've spent time on their boldface text, headings, etc, and they do not like to do this all over again.
- Rich Text Format fields (TinyMCE, CKEditor, etc) are not yet able to properly convert all formatted text into the right HTML. I do not blame them; this has to be very difficult given the odd 'source code' that word processors put in the clipboard. But reading all SO topics about richttext related issues, I feel this is a known limitation.
What do you do in such cases? I've tried the following:
- Explain the client beforehand that this is not a word processor we are implementing, and it has limitations. They can understand, but still want to copy and paste.
- Only show very few buttons for formatting (bold, italic, links). That way, we can strip the tags and clean this up quite well, and this limits issues. Works better, but clients keep asking for font options, more colors, headers, etc.
So not a really good solution in sight. Are there others who have tackled this issue successfully?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一种解决方案(可能是我想出的最好的解决方案)是对粘贴的内容进行后处理。因此,捕获发布事件并纠正所有蹩脚的 HTML——例如,捕获所有“mso-normal”样式,并将其删除。你会有一套规则来清理来自 MS Word 等的内容。
不过,这不仅仅是一个文字处理问题。您从一个富文本编辑器粘贴到另一个富文本编辑器,并且样式不会在富文本编辑环境之间转移。这与其说是一个技术问题,不如说是一个逻辑问题。
更新:有人向我指出:将 Word 复制粘贴到您的 Web CMS。没有真正的解决方案,只是确认这是一个棘手的问题。
One solution (and probably the best I've come up with) is to post-process the pasted content. So, catch the publish event and correct all the crappy HTML -- catch all the "mso-normal" styles, for instance, and remove them. You'd have a set of rules which clean stuff coming out of, say, MS Word.
Though, this is not just a word processing problem. You're pasting from one rich text editor to another, and styles just don't transfer between rich editing environments. This is not so much a technical problem as it is a logical problems.
Update: Someone pointed me to this: Copy-Pasting Word to your Web CMS. No real solutions, but just confirmation that it's a sticky problem.
我完全同意你的观点:
上周我与一位客户进行了一次非常有趣的测试,为此我必须准备一些基于 .NET 的 CMS 系统(Umbraco、Sitefinity、DNN、Composite C1 等)的演示。客户自己有一个基于 Drupal 的网站,而我的 CMS 演示中没有一个能够 100% 地处理复杂的 Word 表,这让我感到羞愧(其他条件不变:我没有做一些 CMS 微调,而是使用了开箱即用的每个 CMS)。最糟糕的是他的 Drupal CMS 做得 100% 好!和Word 中的一模一样。对于经常使用 Word 工作的客户来说,我的 CMS-ses 非常出色。当然,网上有很多关于“您不应该从 Word 复制”或“不要使用 Word 来处理 CMS 事务”的讨论。事实是:客户使用 Word,因此我们应该处理它。
I totally agree with you:
Last week I did a very interesting test with a customer for which I had to prepare some demo's of .NET based CMS systems (Umbraco, Sitefinity, DNN, Composite C1 ect). The customer himself had a Drupal based site and I was ashamed none of my CMS demo's did a 100% job with a complicated Word table (Ceteris paribus: I did not do some CMS fine-tuning, used every CMS out of the box). The worst part was his Drupal CMS did a 100% good job! It was exactly the same as it was in Word. For a client working a lot with Word my CMS-ses were a showstopper. Of course there are a lot of discussions on the web about 'you should not copy from Word' or 'do NOT use Word for CMS things'. Fact is: clients work with Word so we should deal with it.