Hi,
I use the lastest version of CkEditor (4.4.5) - I have migrated my project to 3.42 --> 4.4.5, no problems except when I use in config.js this command: config.removePlugins = 'link'; The block "link" (link / unlink / anchor) is remove from the toolbar, but all links (<a href for example) are remove too from the html source code generated. I have no ideas why...
Somebody can help me ?
Thanks,
Laurent BROUCK
I think you will find that to
I think you will find that to support links you need to have that plugin. there could be some config statement that allows you to keep html links, but without the link toolbar button how do your users get to input a link? Maybe you could just not include link in your toolbar but not exclude it from the plugins either. That way the button will not show up but you will still have the ability to have links in your html. Just a thought
This is how Advanced Content
This is how Advanced Content Filter (ACF) works in automatic mode -- it only allows the sort of content that is supported by enabled plugins. If you disabled linking, linking is disallowed which is quite logical -- usually if a site owner turns some feature off it means that (s)he does not want this feature to be available for the users.
If you want to support the feature, but do not have any toolbar buttons for it, the easiest solution is to just remove the buttons in your configuration (by using config.removeButtons) but leave the link plugin intact.In this case the correct solution is to adjust ACF rules to accept "a" elements with their attributes, as described below.
Read more about ACF in the documentation or better yet, see some working examples in the CKEditor SDK to understand how it works.
Documentation Manager, CKSource
See CKEditor 5 docs, CKEditor 4 docs, CKEditor 3 docs, CKFinder 3 docs, CKFinder 2 docs for help.
Visit the new CKEditor SDK for samples showcasing editor features to try out and download!
Final answer
Thanks php_guy and Anna for your answer.
Anna, I have test with the methods "config.removeButtons = 'Link'" but that is the same behavior as "config.removePlugins = 'Link'", the generated source code are reformatted without tags "<a href..."...
Otherwise, in your article http://sdk.ckeditor.com/samples/acf.html, I have use the "config.allowedContent = true", this method answer to my problems. Thanks for this advices.
My problem is solve, but the behavior of "config.removeButtons = 'Link'" is not the same as you describe in your last post.
Thanks
Actually, it was my mistake,
Actually, it was my mistake, the removeButtons option is integrated with ACF so naturally it will cause the same effect as removing the plugin. Sorry for the confusion!
The method that you used is actually wrong. You disabled content filtering which is a really bad practice in general. You should instead adjust the content filter to also allow the link element even though there is no toolbar button to support it. Just like in the http://sdk.ckeditor.com/samples/acf.html sample, but using the second scenario ("Adjusting Automatic ACF Mode") with the "u" element.
In your case, however, you should also explicitely list the attributes of the "a" element that you want to allow as otherwise these will be removed, too:
This code causes the editor to accept all "a" elements with any attributes.
Documentation Manager, CKSource
See CKEditor 5 docs, CKEditor 4 docs, CKEditor 3 docs, CKFinder 3 docs, CKFinder 2 docs for help.
Visit the new CKEditor SDK for samples showcasing editor features to try out and download!
Re final answer
Hi Anna,
Thanks for you new information, I have modify my config.js according to your advise. Again, your help had me precious :)
Have a nice day,
Laurent