Juergen Posted May 11, 2015 Share Posted May 11, 2015 Hello @ all, I want to disable some of the obsolent and unnecessary attributes ot tables that CKEditor offers, because they are not HTML5 compliant or not necessary. I am talking about the summary, the border and the other attributes that CKEditor offers. I want to disable them so that customers cannot be able to use them. I am not talking about to clean up the html Markup - I can get rid of unwanted markup via a textformatter module, thats not the problem. I am talking about the table plugin button in the editor itself. If you click on that button you will be able to add borders, width, class, id and so on. I want to disable some of them, but I dont know if this is possible or not. Maybe someone can gave me a hint. Best regards Jürgen Link to comment Share on other sites More sharing options...
LostKobrakai Posted May 11, 2015 Share Posted May 11, 2015 How about this? http://docs.ckeditor.com/#!/guide/dev_howtos_dialog_windows 1 Link to comment Share on other sites More sharing options...
Juergen Posted May 11, 2015 Author Share Posted May 11, 2015 Sounds interesting, I will check this tomorrow. Thanks Link to comment Share on other sites More sharing options...
Juergen Posted May 12, 2015 Author Share Posted May 12, 2015 This is the solution to remove unwanted table attributes from CKEditor. Go to /wire/modules/Inputfield/InputfieldCKEditor/ckeditor-4.4.6/config.js and insert this piece of code into the config.js: CKEDITOR.on( 'dialogDefinition', function( ev ) { var dialogName = ev.data.name; var dialogDefinition = ev.data.definition; if (dialogName == 'table') { // Get the advanced tab reference var infoTab2 = dialogDefinition.getContents('advanced'); //Set the default // Remove the 'Advanced' tab completely dialogDefinition.removeContents('advanced'); // Get the properties tab reference var infoTab = dialogDefinition.getContents('info'); // Remove unnecessary bits from this tab infoTab.remove('txtBorder'); infoTab.remove('cmbAlign'); infoTab.remove('txtWidth'); infoTab.remove('txtHeight'); infoTab.remove('txtCellSpace'); infoTab.remove('txtCellPad'); infoTab.remove('txtCaption'); infoTab.remove('txtSummary'); } }); After that you have only a few attributes left. This is the best way to prevent customers from filling out useless table attributes. This works for other plugins (images, links and so on) too. A big thanks to Lostkobrakai for pointing me into the right direction. 4 Link to comment Share on other sites More sharing options...
SiNNuT Posted May 12, 2015 Share Posted May 12, 2015 If it works (can't test) it would be best to add those settings to the site/modules/InputfieldCKEditor dir. Nice stuff, because the table plugin always bothered me. 3 Link to comment Share on other sites More sharing options...
Alex777 Posted June 7, 2015 Share Posted June 7, 2015 (edited) I use Table Tools plugin. The add-on has many tools such as adding, moving and deleting rows and columns, configuring styles of table, selected row or cell. Plugin is very simple in using. Edited June 7, 2015 by Martijn Geerts removed link (commercial interest) Link to comment Share on other sites More sharing options...
Juergen Posted June 8, 2015 Author Share Posted June 8, 2015 Table Tools plugin is another possibility, but you have to purchase it. Another point to mention is that it could be confusing for customers. My experience is that the more possibilities you offer the more problems customers will have. I always tend to make it as simple as possible (ASAP). Dont offer to much settings or possibilities - every additional setting is often a challenge for them. But for better experienced users it will be a very useful plugin to create really complex tables in a quick way. So you have to decide depending on the pros and cons. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now