Why pasting calm from word in to joomla is the bad idea
The reader told me the following:
I have recently edited all the website’s article using JCE Editor. When testing in various browsers, FF, Crome, Safari, all work fine. But IE8 a lot of the articles are missing. After days of searching the web for a solution, it’s clear many people have problems with IE8 and Joomla.
He then went on to explain some possible solutions he’d found on the web. Not so sure about these, my first thought was that it had something to do with the template he was using. After all, the Joomla platform or CMS doesn’t have problems with any browser at all. The template contains the code that is output to the user’s browser. Thus, the best place to look at first is the source code provided by the template (and at the content entered by the user into Joomla).
I looked at the code in Internet Explorer 8, and sure enough, the content didn’t show. It showed up fine in Firefox on the same computer, though. Then I took a look at the source code in IE 8. And there it was… It turned out, the reader had edited his text in Microsoft Word and pasted the content directly from there and into the Joomla editor (JCE). This is a recipe for disaster.
This is what I wrote back to him:
The problem is not with Joomla itself, but with the content you have entered into the page. For instance, if you look at the source code on one of your pages, you will see that the page contains a LOT of code which has been transferred over from MS Word.At the start of this pasted code, you will notice the following: [if gte mso 9]…
This code snippet means the content will only show in Internet Explorer version 9 or greater (and in other browsers, since IE is the only one looking at these IF statements).
Be careful not to paste directly from Word into JCE, or at least use the “Paste from Word” function when doing so. That will remove all of the MS Word specific code from your page.
The reader replied:
Thank you for pointing out it’s not good to copy from Word, I have never seen that advice anywhere before, and have done ALL my editing this way. I’ll use Notepad from now on (or try the paste as plain text button next time).
So now i have pasted a lot of text from MS Word, do you know how i can fix this problem? How do i delete all the code which Word transferred over?
And then do I have to repaste everything again from Notepad?
This was my reply:
Copy the text out of the article (make sure you get everything out (check the source code panel in JCE), paste it into Notepad and repaste into the article.
Of course, when using JCE, he could also be using the “Paste from Word” icon, which strips Word specific coding from the content.
So, pasting from Word should be done with caution. Word adds a lot of specific markup to the content that will be carried over to JCE or other WYSIWYG editors.
The markup is there to make sure the document looks the same when pasted. However, in most cases it is is totally useless and creates all sorts of problems. The above mentioned problem is just one.
Another common problem is that articles pasted from Word look different from other content on the site, as it contains style info that conflicts with the stylesheet of the Joomla template.
This has been a problem for years, and it will probably excist as long as Word is out there…
If you have users on your site that often forget to paste using the “Paste from Word” function you can force JCE to strip Word styles.
Go to Components -> JCE -> Editor Profiles -> [Your profile]
Then navigate to Plugin Parameters and select the tab “Paste”:
On this tab, you have some options that you can activate to have JCE remove more markup from the pasted content.
Sources: http://feedproxy.google.com/Tags: IE, Internet Explorer