windsurfer Posted April 30, 2020 Share Posted April 30, 2020 Is it possible to show line numbers when editing the HTML product description ? Link to comment Share on other sites More sharing options...
bsmither Posted April 30, 2020 Share Posted April 30, 2020 I am finding a special-purpose CKEditor plugin for HTML blocks of <code> and <pre> tags (demo page is 404): https://github.com/ranelpadon/ckeditor-prism And another (probably unpolished) plugin: https://github.com/shemigon/ckeditor-line-numbers-plugin I haven't tested either. Be aware, however, that the content in the editor will reflow when the browser window is resized. Meaning, if wanting to collaborate with others, a differemtly-sized browser window will not show the exact same content per line-numbered row (I'm assuming). Link to comment Share on other sites More sharing options...
windsurfer Posted April 30, 2020 Author Share Posted April 30, 2020 Ya i did all that created a directory called linenumbers placed the plugin.js indside and edited the config to show but that doesn't do it. Link to comment Share on other sites More sharing options...
bsmither Posted April 30, 2020 Share Posted April 30, 2020 That looks strange. Try: config.extraPlugins = 'showprotected,linenumbers'; That is, comma-separated but all within one set of quotes. Link to comment Share on other sites More sharing options...
windsurfer Posted April 30, 2020 Author Share Posted April 30, 2020 When i do that the description window doesn't show up. I also tried to put the linenumbers on it's own line and that doesn't do it either. config.extraPlugins = 'linenumbers' ; Link to comment Share on other sites More sharing options...
bsmither Posted April 30, 2020 Share Posted April 30, 2020 The CKEditor documentation suggests that the comma-separated, then quoted, is the proper format. https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-extraPlugins The browser should have, in its Developer Tools, a javascript console that shows errors. Anything there? Link to comment Share on other sites More sharing options...
windsurfer Posted April 30, 2020 Author Share Posted April 30, 2020 Well now, first i did this config.extraPlugins = 'showprotected,linenumbers'; and it worked except no line numbers in the editor i then figured maybe i left a space at the end of the line so i inserted a space before the semicolon config.extraPlugins = 'showprotected,linenumbers' ; and went back in and i got the same page as i shown in the previous message. I went in and removed the space and it still gives me that page. I cleared the cache, tried IE, firefox and chrome and none will work. I get error codes in the console but when i try to paste them in this message i get told i can't upload more than 153.6 KB I was trying to attach an image that is 81KB but it still tells me i can't upload more than 153.6 KB With the linenumbers removed i still get errors but the editor works. So i put the linenumbers back in as you suggested and rebooted my puter and now the editor works but no line numbers. Still errors though Link to comment Share on other sites More sharing options...
bsmither Posted April 30, 2020 Share Posted April 30, 2020 I'm thinking the part of the documentation on the linenumbers repository that says "Requires AutoGrow" was missed. Please go here: https://ckeditor.com/cke4/addon/autogrow and install it. The red colored console output, Uncaught Error', is making references to 'autogrow'. Link to comment Share on other sites More sharing options...
windsurfer Posted May 1, 2020 Author Share Posted May 1, 2020 Yup, thank you sir, works but still no line numbers and i don't see an option for that either but the autogrow works. After i edited the config.js i did have to restart my computer to make it work though. Link to comment Share on other sites More sharing options...
windsurfer Posted May 1, 2020 Author Share Posted May 1, 2020 Been playing around with the CKeditor and added the autogrow feature and i notice that when i go to edit a product description when i open it up it doesn't display the description and also doesn't autogrow, then when i click on source it shows the HTML code then when i select source again the item description shows up and the window autogrows. Just wondering why it would not show in the first place. Link to comment Share on other sites More sharing options...
bsmither Posted May 1, 2020 Share Posted May 1, 2020 I experimented with these plugins last night. I observed the same as you. I can only think that, because the autogrow plugin is very up-to-date, the problem must lie with the linenumbers plugin (circa 2011). Link to comment Share on other sites More sharing options...
windsurfer Posted May 1, 2020 Author Share Posted May 1, 2020 Taking that out didn't make a difference but what i do notice is that when i select the Description tab the description shows up for a split second and the disappears and no autogrow. Not sure what would cause that. Then when i do a CTRL F5 i get this Link to comment Share on other sites More sharing options...
bsmither Posted May 1, 2020 Share Posted May 1, 2020 Looks like someone tried to complain about it: https://github.com/ckeditor/ckeditor4/issues/3894 Link to comment Share on other sites More sharing options...
windsurfer Posted May 1, 2020 Author Share Posted May 1, 2020 So i had config.extraPlugins = 'showprotected,autogrow,magicline,tableresize'; /* config.extraPlugins = 'showprotected,autogrow,enhancedimage,magicline,tableresize'; */ I tried it with different plugins and with the enhanced image deleted it works , it doesn't autogrow until i hit source and source again though and still no line numbers and i can't really find a concrete answer for that either. I was looking at the autogrow/plugin.js and at the top i get the following, i am not a programmer so i really don't know what it all means but i have a funny feeling it may have some effect. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.