Home >Backend Development >PHP Tutorial >Add one-click typesetting function to ckeditor editor modification_PHP tutorial
Friends who use PHPCMS V9 know that V9 has built-in ckeditor editor, but the typesetting function of the default editor is not very powerful. , the editor of Green Tea below will teach you how to modify the editor and change several places to make Ckeditor editing more practical.
Open statics/js/ckeditor/ckeditor.js
Found:
$.execCommand('unlink',false,null);
Modified to:
$.execCommand('unlink',false,true);
Modify statics/js/ckeditor/plugins/image/dialogs/image.js
Found:
accessKey:'T','default':''
Replace with:
accessKey:'T','default':$('#title').val()
or
Open the file staticsjsckeditorconfig.js and put the following:
config.enterMode = CKEDITOR.ENTER_BR;
config.shiftEnterMode = CKEDITOR.ENTER_P;
Modified to:
config.enterMode = CKEDITOR.ENTER_P;
config.shiftEnterMode = CKEDITOR.ENTER_BR;
Modify form.class.php under the phpcmslibsclasses column to find ['Maximize'], add ['autoformat'] under it, and save it.
Find the config.js file in the staticsjsckeditor folder and find:
config.extraPlugins = 'capture';
Modified to:
config.extraPlugins = 'capture,autoformat';
Just save it. Remember to update the cache and clear cookies after modification.
In fact, the above content is mainly about adding one-click typesetting function to the ckeditor editor. Friends in need can give it a try~ It’s very practical!