Hello,
Some months ago, I tried the TinyMCE wysiwyg on a PHP page to test how it worked. I tried to configure it as I would like people to copy/paste a text from Word or OpenOffice to this wysiwyg, while filtering what they can do or not. I succeed.
Now, I'm working on Drupal 7 and I would like to make the same rules for ckEditor in it. I tried some changes in the ckeditor.config.js of the ckeditor module but nothing happened. I read a lot of things on Internet but I'm not sure where to really look at now. Even my "paste from word" doesn't strip all attributes I don't want. The best solution would be a "paste as plain text" but with some tags allowed I think (p and br are already allowed for example), because the "paste from word" keep a lot of attributes I don't really want / need.
What I want to do is :
- - to make a custom button to call my future module page
- - in formats menu, to show p and all my h2 class (see below), not the current ones
- - to change all titles (h1 to h6) to a h2 class='titleX' where X is the same number as the one next to the H (ex : h1 becomes h2 class='title1')
- - to change u to span class='underline"
- - to keep my tags with allowed properties.
For example, in TinyMCE, it was that little code :
// Allowed tags when copying/pasting or using buttons, with their allowed attributes
valid_elements : "a[href],b/strong,em/i,br,u," +"#p[align],-ol,-ul,-li,img[src|alt=|width|height],-sub,-sup,-table,-tr,-thead,-tbody,#td[colspan|rowspan|align],#th[colspan|rowspan|align],"
+"-span[id|class],-code,-h1[class],-h3[class],-h4[class],-h5[class],-h6[class],-h2[id|class],acronym[title],q[cite]",
// Remove all <span> without a "class" attribute
extended_valid_elements : "span[!class]",
valid_children : "-h2[span],-h2[p],-h2[ol],-h2[ul],-h2[cite],-h2[q],-h2[img],-h2[table],-h2[a],-h2[b],-h2[em],-h2[br],-p[.titre1]",Can you give me somple explanations, links or hints to do this configuration please ? Thank you.